=> VB Command button to Execute Excel Macro

  • Thread starter Thread starter Rhonda Fischer
  • Start date Start date
R

Rhonda Fischer

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
 
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)
 
Back
Top