I am sorry my friend but your code is no good.
1. If you are looking at a large range the last thing you want to do is to use a loop.
2.
LR = Cells(rows.count,1).End(xlUp).Row
Will return the last row in column A.
LR = Cells(Rows.Count, "Y").End(xlUp).Row
Will return the last row in column Y.
What makes you sure that Column Y is your longest column?
Perhaps you should use
LCR = Selection.SpecialCells(xlCellTypeLastCell).Row
I will rewrite your code for you.
This is more complicated than your code but hundreds of times faster.
Mainly because it uses the find function rather than a loop.
Sub Negative_Convert()
Application.ScreenUpdating = False
Cells.Select
Set RngLook = Selection
Range("A1").Select
On Error Resume Next
With RngLook
Set rngFind = .Find("CR", .Cells(1, 1), LookIn:=xlValues, lookat:=xlWhole)
If Not rngFind Is Nothing Then
rngFind.Offset(0, -1).Value = -rngFind.Offset(0, -1).Value
rngFind.Value = ""
Do
Set rngFind = .FindNext(rngFind)
rngFind.Offset(0, -1).Value = -rngFind.Offset(0, -1).Value
rngFind.Value = ""
Loop While Not rngFind Is Nothing
End If
End With
On Error GoTo 0
Application.ScreenUpdating = True
End Sub
Bookmarks