Assign Macro function

  • Thread starter Thread starter gus
  • Start date Start date
G

gus

Hi!
I've inserted a command button on my spreadsheet and I want to assing a
macro to it, however when I right-click the object, the option "Assign
Macro" is not available. How do I solve that?

Thanks,
Gus
 
Hi Gus.
I've inserted a command button on my spreadsheet and I want to assing a
macro to it, however when I right-click the object, the option "Assign
Macro" is not available.

Possibly it's a command button of the Control ToolBox variety. Do you have a
"View Code" rightclick option?

HTH,
Andy
 
But I don't know how to assign a macro this way. Any clue?

Select the View Code option, you'll be transported to the Visual Basic
Editor. Excel will give you a head start with something like

Private Sub CommandButton1_Click()

End Sub

, whatever you want the button to do (e.g. MsgBox "Hi!") goes between the
lines. Tho' when you switch back to Excel proper, make sure you Exit Design
Mode (first icon/button on the Control ToolBox).

Rgds,
Andy
 
Perfect, Andy!
I'll create a macro separately, and then I'll copy/paste the code.
Thanks so much!

Gus
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Assigning Macros 4
Assign Macro 1
Macor Button Dissapears 2
Create A Button and Assign A Macro To It 2
Assigning A Macro to A Button 1
Macro code behind button 1
Solver Compiler issue 2
Assign Macro to a Cell 2

Back
Top