Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am writing VBA to generate user input sheets, within
these I can create command buttons and change the caption but how do I programatically make this button call a macro when it is clicked? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Andy,
Can you create your command button(s) at design time but make Visible = False until you need them to be shown, when you set Visible = True. You can have many invisible controls on a form and only make the ones you need visible when you want the user to be able use them. If you've got many controls, you can also put them one on top of the other to save space. Only the topmost, visible one will be shown and accessible. If you're not short of space, you could have the controls visible but set Enabled = False. That way, the user can still see them but cannot do anything with them (they're greyed out). HTH Henry "Andy" wrote in message ... I am writing VBA to generate user input sheets, within these I can create command buttons and change the caption but how do I programatically make this button call a macro when it is clicked? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If they are buttons from the control toolbox toolbar, just double click on one
and you'll be in the _click procedure. This code would be under the worksheet that owns the button. if they are from the Forms toolbar, then rightclick on it and choose assign macro. these macros would be in a general module. Andy wrote: I am writing VBA to generate user input sheets, within these I can create command buttons and change the caption but how do I programatically make this button call a macro when it is clicked? -- Dave Peterson |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Does this (http://www.cpearson.com/excel/vbe.htm) help?
-- Bob Kilmer "Andy" wrote in message ... I am writing VBA to generate user input sheets, within these I can create command buttons and change the caption but how do I programatically make this button call a macro when it is clicked? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Command Buttons | Excel Discussion (Misc queries) | |||
Command Buttons | Excel Discussion (Misc queries) | |||
Command buttons | Excel Programming | |||
command buttons | Excel Programming | |||
Control Buttons vs. Command Buttons | Excel Programming |