Code to auto fill down two rows from active selection.

richanor

Active Member
Joined
Apr 8, 2006
Messages
291
Hi,

I am using the following code to insert a couple of rows into a worksheet and then select a range above them. I want to be able to auto fill down into these two rows and then change the active cell to the next cell in column A ending with a 5 or a 0.

If the second part is not possible, could anybody help me with the code to auto fill down a couple of rows from the selected range?

Thanks

Rich

Code:
Sub InsertRows()
'
' InsertRows Macro
'
' Keyboard Shortcut: Ctrl+Shift+I
'
    Selection.EntireRow.Insert
    Selection.EntireRow.Insert
    ActiveCell.Offset(-3, -Selection.Column + 1).Range("A1:F3").Select

End Sub
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type

Forum statistics

Threads
1,223,958
Messages
6,175,636
Members
452,662
Latest member
Aman1997

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