Choose View, Toolbars, and pick the Forms toolbar. Click the Button tool
and then click in the spreadsheet. You will be prompted for the macro you
want to assign. You can resize and move the button after assigning the macro.
Hi,
Sounds simple, but I am using Excel2007 (Vista) and I can't find "Toolbars"
or "Forms" on the ribbon under View, and the help function has not "helped".
What am I missing?
Choose View, Toolbars, and pick the Forms toolbar. Click the Button tool
and then click in the spreadsheet. You will be prompted for the macro you
want to assign. You can resize andmovethe button after assigning the macro.
How do I move the button and macro? When I move the button, the macro
stays in place it was created. I would like to add rows to my
worksheet, but when I do all of my macros are askew.
The macro stays assigned to the button no matter where you move it.
If your macro relies on the position of the button, you could check in your
code.
For instance:
Option Explicit
sub testme()
dim BTN as button 'from the Forms toolbar!
set btn = activesheet.buttons(application.caller)
msgbox btn.topleftcell.address 'just to show you.
'select the row that contains the topleftcell of the button
btn.topleftcell.entirerow.select
end sub
Create you macro first. Now make sure you have the "Drawing" toolba
visible (View/Toolbars/Drawing). Next create the button on th
spreadsheet using either the "Rectangle" or "Oval" option on th
Drawing toolbar. Then right-click on the button and click on "assig
Macro". Select the macro you want to execute when the button i
pressed. You can put text on the button or colour it, if you like.
regards
mj
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.