Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adding Buttons to Worksheet
This is a problem that has vexed me for sometime (I typcially just copy
buttons out of old worksheets and reassign macros in the newly created worksheet), and it is high-time I figure it out. How does one create a button in an excel worksheet? I have tried the UserForm route with no success, and I am sure there is something simple here that I am just not catching. Needless to say I am very frustrated with this, and any help is most appreciated. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adding Buttons to Worksheet
Manually???
There are two buttons that look alike, but behave differently. One is on the Forms toolbar. The other is on the Control toolbox toolbar. In either case, just show that toolbar. click on the button you like back to the worksheet and click to anchor a corner. Then drag to the opposite corner. If you chose to use the Forms button, you'll be prompted for a macro name to assign to this button. (You can dismiss that dialog and assign it later if you want). If you chose the control toolbox toolbar commandbutton, you can double click on that button and put your code in that _click event. And you know that you can use objects from the Drawing toolbar (as well as other controls from the Forms toolbar) and assign macros to them, too. wrote: This is a problem that has vexed me for sometime (I typcially just copy buttons out of old worksheets and reassign macros in the newly created worksheet), and it is high-time I figure it out. How does one create a button in an excel worksheet? I have tried the UserForm route with no success, and I am sure there is something simple here that I am just not catching. Needless to say I am very frustrated with this, and any help is most appreciated. -- Dave Peterson |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adding Buttons to Worksheet
Hello Paul, There are 2 ways to create buttons and other objects on an Excel worksheet. First is by using the Forms Toolbar. Click on View on the Excel Menu Bar and select Toolbars. If the Forms Toolbar is visible it will a check mark beside it. Clicking it will switch the toolbar's visible state. These control have the advantage of being easy to use, especially with recorded macros. The down side is they aren't very robust. The second type are the Control ToolBox objects which are part of VBA. You can access these from the VBA Toolbar. You can check if it visible just like I stated above. The provide you with features and flexibility, but are far more complex to program. To see the controls available click on the wrench and hammer icon. Once you have the toolbar displayed, you can select which control you want to place on the worksheet. Click on the object, place the cursor where you want to draw the control and left click and hold while you move the mouse. You can control the size as you move. You can always resize a control after you draw it. That's the basics. It should get you started on your way. Sincerely, Leith Ross -- Leith Ross ------------------------------------------------------------------------ Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465 View this thread: http://www.excelforum.com/showthread...hreadid=478400 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adding Buttons to Worksheet
Just curious why you say the controls from the Forms toolbar aren't very
robust. They're not as "feature rich" like the controls from the control toolbox toolbar (like you said), but I've found them to be very robust. In fact, I've had fewer problems with the Forms controls than the control toolbox controls. Leith Ross wrote: Hello Paul, There are 2 ways to create buttons and other objects on an Excel worksheet. First is by using the Forms Toolbar. Click on View on the Excel Menu Bar and select Toolbars. If the Forms Toolbar is visible it will a check mark beside it. Clicking it will switch the toolbar's visible state. These control have the advantage of being easy to use, especially with recorded macros. The down side is they aren't very robust. The second type are the Control ToolBox objects which are part of VBA. You can access these from the VBA Toolbar. You can check if it visible just like I stated above. The provide you with features and flexibility, but are far more complex to program. To see the controls available click on the wrench and hammer icon. Once you have the toolbar displayed, you can select which control you want to place on the worksheet. Click on the object, place the cursor where you want to draw the control and left click and hold while you move the mouse. You can control the size as you move. You can always resize a control after you draw it. That's the basics. It should get you started on your way. Sincerely, Leith Ross -- Leith Ross ------------------------------------------------------------------------ Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465 View this thread: http://www.excelforum.com/showthread...hreadid=478400 -- Dave Peterson |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adding Buttons to Worksheet
Hello Dave, This was one of those times when the right word eluded me. "Robust" really wasn't the best word or phrase to use, but I couldn't think of anything else at the moment. "Feature rich" sums it up perfectly. Thank you. Sincerely, Leith Ross -- Leith Ross ------------------------------------------------------------------------ Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465 View this thread: http://www.excelforum.com/showthread...hreadid=478400 |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adding Buttons to Worksheet
Then we are in violent agreement <vbg.
Leith Ross wrote: Hello Dave, This was one of those times when the right word eluded me. "Robust" really wasn't the best word or phrase to use, but I couldn't think of anything else at the moment. "Feature rich" sums it up perfectly. Thank you. Sincerely, Leith Ross -- Leith Ross ------------------------------------------------------------------------ Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465 View this thread: http://www.excelforum.com/showthread...hreadid=478400 -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Adding buttons to a new menu bar | Excel Worksheet Functions | |||
Adding value to option buttons | Excel Discussion (Misc queries) | |||
Adding ToolTips to buttons | Excel Programming | |||
Adding buttons with macros | Excel Programming | |||
Programmatically adding buttons to a worksheet (Shape Object) | Excel Programming |