Option Explicit
Sub AddMinus()
Dim i As Long, lr As Long
lr = Range("Y" & Rows.Count).End(xlUp).Row
For i = 2 To lr
If Not IsNull(Range("Y" & i)) Then
Range("Y" & i) = "-" & Range("Y" & i)
End If
Next i
End Sub
Ps. If Your 'AddMinus' runs twice ... are values still negative?
Option Explicit
Sub MY_Minus()
Dim i As Long, lr As Long
lr = Range("Y" & Rows.Count).End(xlUp).Row
For i = 2 To lr
If IsNumeric(Range("Y" & i)) Then
Range("Y" & i) = _
IIf(Range("Y" & i) <= 0, Range("Y" & i), -1 * Range("Y" & i))
End If
Next i
End Sub
Sub Demo1()
Dim F$
F = ThisWorkbook.Path & Application.PathSeparator & "sample1.xls"
If Dir(F) > "" Then
With Workbooks.Open(F, False).Worksheets(1).[A1].CurrentRegion.Rows
With .Item("2:" & .Count).Columns(25)
.Value2 = .Parent.Evaluate(Replace("IF(#>0,-#,#)", "#", .Address))
End With
.Parent.Parent.Close True
End With
End If
End Sub
Sub abc()
Dim i As Long
Dim lr As Long
Dim wbk1 As Workbook
Dim wsh1 As Worksheet
Application.ScreenUpdating = False
Set wbk1 = Workbooks.Open(ThisWorkbook.Path & "\ap.xls")
Set wsh1 = wbk1.Worksheets(1)
With wsh1
lr = Range("Y" & Rows.Count).End(xlUp).Row
For i = 2 To lr
If IsNumeric(Range("Y" & i)) Then
Range("Y" & i) = _
IIf(Range("Y" & i) <= 0, Range("Y" & i), -1 * Range("Y" & i))
End If
Next i
End With
Application.DisplayAlerts = False
wbk1.Close SaveChanges:=True
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub