Macro to select 4 entire rows and then delete rows

S

Scott Viney

Afternoon All,

Ive never written a macro before. So excuse me if this is dead simple.

With VBA how can I create a macro that when I select an entire row with the
mouse then run the macro. It selects the next 3 entire rows below then,
deletes these rows.

Any help will be appreciated,
Scott V
 
J

JE McGimpsey

One way:

Public Sub Delete4Rows()
Selection.Resize(4).EntireRow.Delete
End Sub
 
R

Ron de Bruin

Hi Scott

This example will delete the activecell row and 3 rows below it

Cells(ActiveCell.Row, 1).Resize(4, 1).EntireRow.Delete
 
S

Scott Viney

Thanks JE,

If I wanted it to say start a specific entire row, then from there delete 4
entire rows. Then move down a fixed number of rows then do the same thing
till it run out of data how would I go about this.

Scott
 
Top