Marco Help

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello
I have a text box with an assigned macro. I want th run two macros off of
the button. Which macro runs will depend on the location of the active cell.
User will have two options. If cell A1 active, button will run macro a. If
cell B1 active, button will run macro b.

Tank you
 
assign ur button to macro "Butt"

Sub Butt()
If ActiveCell.Address = "$A$1" Then Call a
If ActiveCell.Address = "$B$1" Then Call b
End Sub

Sub a()
MsgBox ("") & ActiveCell.Address
End Sub

Sub b()
MsgBox ("") & ActiveCell.Address
End Sub


"looper" skrev:
 

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

Back
Top