Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Delete Every 2nd & 3rd Row
The sequel?
Sub SpeedII() With ActiveSheet.UsedRange With .Columns(.Columns.Count + .Column + 1) .Formula = "=1/n(1+mod(row(a1),3)=2)" .SpecialCells(xlCellTypeFormulas, xlErrors).EntireRow.Delete .Value = "" End With End With End Sub Regards Robert McCurdy "excelent" wrote in message ... The sub looks in column A for the last row with values Then it use column IV temporary - i ges u dont use that one :-) try on a copy of ur sheet first, just in case Sub Speed() r = Cells(65536, 1).End(xlUp).Row ' if not col.A change '1' to right one For t = 4 To r Step 3 Cells(t, 256) = 1 Next Range("IV2:IV" & r).SpecialCells(xlCellTypeBlanks).EntireRow.Delete Range("IV2:IV" & r) = "" End Sub "Mickey" skrev: Hi, I need to find a quicker way to delete every 2nd & 3rd row of three rows. e.g. Delete Row 2 & 3, then 3 & 4, then 4 & 6. Can anyone help?, The below does it but requires me to add a statement for each set of three rows, as the data can vary from 3 rows to several thousand, I need something more automatic. Sub Macro1() ' ' Rows("2:3").Select Selection.Delete Shift:=xlUp Rows("3:4").Select Selection.Delete Shift:=xlUp Rows("4:5").Select Selection.Delete Shift:=xlUp End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Delete Every 2nd & 3rd Row
Thanks Robert,
Mickey |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro to delete sheets and saves remaining file does not properly delete module | Excel Programming | |||
Macro to delete sheets and saves remaining file does not properly delete module | Excel Programming | |||
Macro to delete sheets and saves remaining file does not properly delete module | Excel Programming | |||
Macro to delete sheets and saves remaining file does not properly delete module | Excel Programming | |||
Delete every 3rd row, then delete rows 2-7, move info f/every 2nd row up one to the end and delete the row below | Excel Programming |