Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default VBA generated command buttons

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 104
Default VBA generated command buttons

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default VBA generated command buttons

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 280
Default VBA generated command buttons

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Command Buttons Command Button Calculations Excel Discussion (Misc queries) 4 May 25th 10 06:51 PM
Command Buttons Hoyas07 Excel Discussion (Misc queries) 2 February 11th 08 03:42 PM
Command buttons Russell Stevenson Excel Programming 3 November 12th 03 02:57 AM
command buttons Mauricio R. Excel Programming 2 November 4th 03 11:18 AM
Control Buttons vs. Command Buttons Robert Gibson Excel Programming 1 October 13th 03 04:33 PM


All times are GMT +1. The time now is 08:54 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"