How can I delete rows accordinng to formula
First, delete rows from the higher numbered rows first, or your loop won't
work.
For i = 100 to 1 step -1
rows(3*i).delete Shift:=xlUp
rows(3*i-1).delete Shift:=xlUp
Next
"GreenInIowa" wrote in message
...
Hi,
I am trying to delete bunch of empty rows, which are regularly spaced in
my
worksheet, using "FOR-NEXT" loop. But, it is giving me error. What I my I
doing wrong here. Thanks.
Sub Macro1 ()
For i = 1 To 100
n = 3 * i - 1
ActiveSheet.Rows("n, n + 1").Select
Next
Selection.Delete Shift:=xlUp
End Sub
|