Select always same Rows range
I'm not sure, but I'm guessing you want something like this:
Dim LastRow As Long
With ActiveSheet
LastRow = .Cells(.Rows.Count, "B").End(xlUp).Row
End With
Rows(LastRow + 1 & ":500").Select
Selection.Delete Shift:=xlUp
Regards,
Paul
"Nauj Solrac" wrote in message
...
I'm trying to select (LastRow+1:500) in many spreadsheets but I got error
in
my macro. Example:
Dim LastRow As Long
With ActiveSheet
LastRow = .Cells(.Rows.Count, "B").End(xlUp).Row
End With
*ERROR* Rows("LastRow + 1:500").Select <-- *ERROR*
Selection.Delete Shift:=xlUp
Can anyone give and idea to do that selection ? Thanks in advance.
|