Need help with adding a button to sheet

  • Thread starter Thread starter Dan B
  • Start date Start date
D

Dan B

Hi,
I have a spreadsheet that is linked to an Access database. I have created a
macro that will update or sync the sheet with the database. I want to make
it so a user can just click a button to run that macro. I have the button
on the sheet, but I'm not sure how to make it run the macro. Please Help.

Thanks,
Dan
 
Dan,

If you placed the button on the sheet and it didn't prompt you for the
name of the macro, you probably used a button from the
Controls Toolbox.

Right click on the button and select "View Code"
You'll be taken to the "Click" event for that button.
Just place the name of your macro between the Sub.. and End Sub.

Or....delete that button and select one from the "Forms" toolbar.
As soon as you create the button, you'll be prompted for the
macro to assign to it

John
 
Perfect....Thanks!!



John Wilson said:
Dan,

If you placed the button on the sheet and it didn't prompt you for the
name of the macro, you probably used a button from the
Controls Toolbox.

Right click on the button and select "View Code"
You'll be taken to the "Click" event for that button.
Just place the name of your macro between the Sub.. and End Sub.

Or....delete that button and select one from the "Forms" toolbar.
As soon as you create the button, you'll be prompted for the
macro to assign to it

John

created
 
Back
Top