Select always same Rows range

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Last Row range 3
Macro range 2
Paste Filtered Range to New Workbook- AS 2
Collate data 1
Calculate Range 3
After Macro runs, no cell activated - what am I missing? 2
Is not sorting 4
Macro-indirect cell 4

Back
Top