Help!

Help with a Macro

 
  

Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> General Discussions RSS
Next:  Why always defaulting to US English Dictionary?  
Author Message
hpoincare
External


Since: Nov 06, 2009
Posts: 1



PostPosted: Fri Nov 06, 2009 7:00 am    Post subject: Help with a Macro
Archived from groups: microsoft>public>excel>misc (more info?)

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
Back to top
Luke M
External


Since: Jan 08, 2009
Posts: 187



PostPosted: Fri Nov 06, 2009 7:33 am    Post subject: RE: Help with a Macro [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"hpoincare" wrote:

> 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
>
>
Back to top
Display posts from previous:   
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> General Discussions All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum