Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default Select always same Rows range

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.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,311
Default 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.



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default Select always same Rows range

Great !!! Thank You so much.

"PCLIVE" wrote:

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.




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Select a range [email protected] Excel Discussion (Misc queries) 1 March 22nd 07 10:16 AM
Select Using Range vijaya Excel Discussion (Misc queries) 1 November 2nd 05 07:33 PM
I cannot select a range Kassie Excel Discussion (Misc queries) 3 February 21st 05 06:09 AM
Select a range Kevin Excel Discussion (Misc queries) 3 February 18th 05 11:04 PM
Unable to select rows in the repeat rows on top option Noppie Excel Discussion (Misc queries) 2 December 28th 04 03:17 PM


All times are GMT +1. The time now is 08:49 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"