Hello All,
I have an issue that occurs in a couple of my macros. This code works fine:
However, I have some problems with the following:
or
The problems arise when I have deleted rows in the data, then run the macros containing either of the last two examples. My understanding from reading other posts is that xlLastCell is problematic and doesn't reset immediately. How can I rewrite the last two code examples using xlUp? Any help would be wonderful.
I have an issue that occurs in a couple of my macros. This code works fine:
Code:
Dim LineCount As Long, i As Long
LineCount = Range("A65536").End(xlUp).Row
For i = 1 To LineCount
' Perform data steps here
Next i
However, I have some problems with the following:
Code:
Range("V1:V" & Range("V1").SpecialCells(xlLastCell).Row).Interior.ColorIndex = 45
Code:
Range("Z1:Z" & Range("Z1").SpecialCells(xlLastCell).Row).Value = " "
The problems arise when I have deleted rows in the data, then run the macros containing either of the last two examples. My understanding from reading other posts is that xlLastCell is problematic and doesn't reset immediately. How can I rewrite the last two code examples using xlUp? Any help would be wonderful.