create a control button to insert rows

N

nadswilkes28

I want to creat a button on my spreadsheet then when you click on it you will
automatically insert a row above it.
 
N

nadswilkes28

I have a lot of different users to use my spreadsheet and some of them
continually mess up the whole insert row process so I am wanting to create a
button that all they have to do is click on and it will then automatically
insert rows for them. Thanks
 
J

JMay

Add an Active-X Command Button to your worksheet.

Then in the Sheet Code window select the object Command_Click (left
drop-down)and make it look like this:

Private Sub CommandButton1_Click()
ActiveCell.EntireRow.Insert '<<< Add this
End Sub

Hope this helps,
Jim May
 
G

Gord Dibben

There is an insert row button on the Tools>Customize>Commands>Insert category
that can be dragged to a new toolbar you crate by Tools>Customize>Toolbars>New

You can dock that most anywhere.

If you really want a macro assigned to a button, drop a button from the Forms
Toolbar onto your sheet and assign this code.

Sub insert()
Selection.EntireRow.insert
End Sub


Gord Dibben MS Excel MVP
 
Top