button in a cell to activate a macro

  • Thread starter Thread starter alexfair
  • Start date Start date
A

alexfair

Is there a way to create a button in a cell that when clicked will activate a
macro?

Thanks
 
Display the Forms toolbar, select the Button button, and drag a
rectangle on your worksheet. It will prompt you to assign the macro.
I haven't tried this in 2007, but I imagine that they moved this to
one of the drawing tools now.
 
Hi,
One way:
View > Toolbars > Forms
Select the button (hover mouse over each to find "button")
Click on the sheet where you want the button to be.
The Assign Macro window will open.
Choose the macro you want the button to run.
Format the button as desired (Change size, text, etc)
Click away from the button to exit edit mode.
Click button to run macro.

You can also do the same with the shapes from the drawing toolbar

Regards - Dave.
 
great, i was trying to do the same thing, another poster helped me there. if
i accidently created one, how do i delete it?
 
nevermind, i was able to delete it.

Ann said:
great, i was trying to do the same thing, another poster helped me there. if
i accidently created one, how do i delete it?
 
Buttons cannot go into a cell.

They can only lie on top of a cell.

See other replies for adding a button to your sheet.

If you want to just double-click on a cell use double-click event code in the
sheet module.

Private Sub Worksheet_BeforeDoubleClick( _
ByVal Target As Excel.Range, Cancel As Boolean)

your code or macroname

End sub


Gord Dibben MS Excel MVP
 
Back
Top