View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
BB BB is offline
external usenet poster
 
Posts: 39
Default need macro script - repeat to delete 2 rows

Thank you. It works, however it delete the columns and keep each row of
column D. I need all info in the row.

How do you figure it out this complicated script? Can you show me how to
use record and stop record in macro easy steps?

"Gary''s Student" wrote:

Try:

Sub delete_rows()

Dim r As Range, j As Long

Set r = ActiveSheet.UsedRange
j = r.Rows.Count + r.Row
Set rdel = Cells(j, "A")

k = 0
For i = 1 To j - 1
k = k + 1
If k = 4 Then
k = 1
End If
If k = 3 Then
Else
Set rdel = Union(rdel, Cells(i, "A"))
End If
Next
rdel.EntireRow.Delete

End Sub

--
Gary's Student


"BB" wrote:

I need to repeat deleting 2 rows, skipping 1 row, then deleting 2 rows again
and skipping 1 row.

How to run macro on this? Please help.