Need a macro to insert a row in the row above a button

D

David

I'm trying to create a macro that inserts a row above a
row that would have a button (telling the user "click
here to add a new row").

I want to create many of these buttons at different
points in the worsheet. The problem with the approach I
used is that the active cell doesn't change to the button
location when the button is clicked.

Any ideas would be appreciated.

David
 
B

Bob Phillips

David,

Why bother having many buttons, why not just one that inserts a row above
the active cell, whichever one that might be?

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
G

Guest

I only want the user to have the option in certain places
because of some subtotals, etc.

Any ideas on how to do this?

David
 
T

Tom Ogilvy

if a control toolbox toolbar commandbutton

set rng = Activsheet.OleObjects("CommandButton1").TopLeftCell

rng.EntireRow.Insert
 
Top