Assign Macro to Command Button

P

ProjectUser

I’ve created a fairly simple macro that I’d like to assign to a command
button.
Here’s the code I’ve used, but has failed on me.
Private Sub CommandButton1_Click()
Dim mac As Application
mac.Macro “Show Value"
End Sub
Can someone help me with this error?
Thanks.
 
J

Jim Aksel

Assume the existance of a Macro called "ShowValue"

Public Sub ShowValue()
'Any code you want
End Sub

On your user form:

Private Sub CommandButton1_Click()
ShowValue
End Sub





--
If this post was helpful, please consider rating it.

Jim

Visit http://project.mvps.org/ for FAQs and more information
about Microsoft Project
 

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

Top