Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Deleting Multiple Blank Rows | Excel Discussion (Misc queries) | |||
Deleting a rows from multiple worksheets | Excel Worksheet Functions | |||
deleting multiple rows | Excel Discussion (Misc queries) | |||
deleting multiple rows with multiple criteria | Excel Programming | |||
Deleting multiple rows within a spreadsheet | Excel Programming |