A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

=> VB Command button to Execute Excel Macro



 
 
Thread Tools Display Modes
  #1  
Old January 26th, 2004, 10:45 AM
Rhonda Fischer
external usenet poster
 
Posts: n/a
Default => VB Command button to Execute Excel Macro

Hello,

I am attempting to execute an Excel Macro using the
on_click event of a VB button. I have not as yet had
much success. I am able to get as far as drawing the
VB button on the Excel spreadsheet in design mode,
however on execution the Macro1 is not recognised.

Any suggestions would be very much appreciated.

Thank you kindly
Rhonda
  #2  
Old January 26th, 2004, 10:53 AM
Bob Phillips
external usenet poster
 
Posts: n/a
Default => VB Command button to Execute Excel Macro

Rhonda,

By virtue of you mentioning design mode, I assume you mean control buttons,
not forms.

After drawing the button, whilst still in design mode, double-click the
button, and you will be taken to the worksheet code module, with a skeleton
event code macro for that button already created

Private Sub CommandButton1_Click()

End Sub

Just add your code, or a call to you macro, in that event macro.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Rhonda Fischer" wrote in message
...
Hello,

I am attempting to execute an Excel Macro using the
on_click event of a VB button. I have not as yet had
much success. I am able to get as far as drawing the
VB button on the Excel spreadsheet in design mode,
however on execution the Macro1 is not recognised.

Any suggestions would be very much appreciated.

Thank you kindly
Rhonda



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:52 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.