VBA to Delete Specific # of Rows

Sundae

New Member
Joined
Jul 25, 2011
Messages
44
Hi,

I am sure this is an easy one for you gurus, but since I am new to VBA I am having trouble:

How do I write code to delete the row of the current cell activated plus the 4 rows below?

Thanks!
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
This single line of code will do what you asked for...

Code:
ActiveCell.Rows.Resize(5).EntireRow.Delete
Put it in your macro at whatever location you need it to be at.
 
Upvote 0
Thank you - you have been a great help to me in my learning VBA. I have another post titled "Loop Question" that I have had no replies to. Everyone on this great forum is normally so quick reply. Any chance you could look at it?

Thanks!
 
Upvote 0

Forum statistics

Threads
1,224,507
Messages
6,179,183
Members
452,893
Latest member
denay

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top