Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default deleting multiple rows

Hi,
I need to delete subsequent rows, but i have to address the starting and the
end points by referring two cells.

I mean i dont want to use this:
Rows("2:5").Delete
But use this(something like this):
?? Rows( & Cells(1,2):Cells(1,3) & ).Delete ??

Can you please help? I couldn't find something like that in help pages.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 694
Default deleting multiple rows

Hi,
try something like:
Range(Cells(1,2) , Cells(1,3) ).EntireRow.Delete
--
Regards,
Sébastien
<http://www.ondemandanalysis.com
<http://www.ready-reports.com


"nerohnze" wrote:

Hi,
I need to delete subsequent rows, but i have to address the starting and the
end points by referring two cells.

I mean i dont want to use this:
Rows("2:5").Delete
But use this(something like this):
?? Rows( & Cells(1,2):Cells(1,3) & ).Delete ??

Can you please help? I couldn't find something like that in help pages.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,202
Default deleting multiple rows

I'm guessing you are looking for something like this...

Range(Cells(2, 1).Row & ":" & Cells(5, 1).Row).Delete

Note that your original Cell references were both using Row 1 (1st argument
in Cells) and changing the Column (2nd argument in Cells); the above
reverses them so the correct rows are being deleted.

Rick


"nerohnze" wrote in message
...
Hi,
I need to delete subsequent rows, but i have to address the starting and
the
end points by referring two cells.

I mean i dont want to use this:
Rows("2:5").Delete
But use this(something like this):
?? Rows( & Cells(1,2):Cells(1,3) & ).Delete ??

Can you please help? I couldn't find something like that in help pages.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default deleting multiple rows

another few to delete rows 2:5 (4 total rows)

Rows(2 & ":" & 5).Delete
or
rows(2).resize(4).delete
or
You can use this kind of syntax when you know the top and bottom rows to delete:
rows(2).resize(5-2+1).delete
like:
Dim TopRow as long
Dim BotRow as long
toprow = 2
botrow = 5
rows(toprow).resize(botrow-toprow+1).delete


nerohnze wrote:

Hi,
I need to delete subsequent rows, but i have to address the starting and the
end points by referring two cells.

I mean i dont want to use this:
Rows("2:5").Delete
But use this(something like this):
?? Rows( & Cells(1,2):Cells(1,3) & ).Delete ??

Can you please help? I couldn't find something like that in help pages.


--

Dave Peterson
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
Deleting Multiple Blank Rows Diabolo_Devil[_2_] Excel Discussion (Misc queries) 6 March 12th 10 03:20 PM
Deleting a rows from multiple worksheets School Teacher Excel Worksheet Functions 0 July 6th 05 06:52 PM
deleting multiple rows Pablo Excel Discussion (Misc queries) 4 January 27th 05 07:18 PM
deleting multiple rows with multiple criteria Pablo Excel Programming 3 January 27th 05 02:04 AM
Deleting multiple rows within a spreadsheet Jeff[_30_] Excel Programming 2 April 26th 04 07:31 PM


All times are GMT +1. The time now is 11:29 PM.

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

About Us

"It's about Microsoft Excel"