Select always same Rows range

N

Nauj Solrac

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.
 
P

PCLIVE

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
 
N

Nauj Solrac

Great !!! Thank You so much.

PCLIVE said:
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
 
Top