Help with a Macro

H

hpoincare

Office Excel 2007 - latest updates.

I want to place my cursor in a cell $D, run my macro and have it:

Delete 3 rows (entirely) above my selected cell (row)
Delete 6 rows (entirely) below my selected cell (row)

and then move my cursor to 10 rows beneath my original selected cell $D

I need for this to work irrespective of the actual row locations. I want
the macro to reference only the current location of my cursor in my D column.

Thanks
 
L

Luke M

Sub MyMacro()
Application.ScreenUpdating = False

Range(ActiveCell.Offset(6, 0), ActiveCell.Offset(1, 0)).EntireRow.Delete
Range(ActiveCell.Offset(-3, 0), ActiveCell.Offset(-1, 0)).EntireRow.Delete
ActiveCell.Offset(10, 0).Select

Application.ScreenUpdating = True
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top