Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to delete rows
I have a list that i am copying and pasting from a
different location with entirely too much information. I am looking for a macro to delete 3 rows, leave the 4th, delete the next 3 and so on. For example: Starting at row 23, leave 23, delete row 24, 25, 26, leave row 27, delete row 28, 29 and 30, and so on and so forth over a given range. Can anyone help? Thanks for your time, Steve |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to delete rows
Hi Steve,
Sub Test() Dim Rw, LastRw, Rw3 As String Rw = 23 ' 1st row LastRw = 123 ' last row in range Do Rw3 = Rw + 1 & ":" & Rw + 3 Rows(Rw3).Delete Rw = Rw + 1 LastRw = LastRw - 3 Loop Until Rw = LastRw End Sub regards, Don "Steve" wrote in message ... I have a list that i am copying and pasting from a different location with entirely too much information. I am looking for a macro to delete 3 rows, leave the 4th, delete the next 3 and so on. For example: Starting at row 23, leave 23, delete row 24, 25, 26, leave row 27, delete row 28, 29 and 30, and so on and so forth over a given range. Can anyone help? Thanks for your time, Steve |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro to delete rows | Excel Discussion (Misc queries) | |||
Macro to delete Rows 1, 3 and 10 | Excel Programming | |||
Macro to delete rows | Excel Programming | |||
macro to delete entire rows when column A is blank ...a quick macro | Excel Programming | |||
HOW TO: Delete Rows with a Macro | Excel Programming |