result from userform click...

  • Thread starter Thread starter SpeeD
  • Start date Start date
S

SpeeD

hi.

I´m running a macro that prompts the user for a form, so that the user could
choose from 3 options (3 click buttons...) how can i return that chosen
"click" (value) to my macro so it continues and GOTO another part of the same
macro??

Sorry but i still have no final code.... i hope i could make my self clear!!!

Thank´s speed
 
In the form

Private mcButton1 As Boolean
Private mcButton2 As Boolean
Private mcButton3 As Boolean

Public Property Get Button1() As Boolean
Button1 = mcButton1
End Property

Public Property Get Button2() As Boolean
Button2 = mcButton2
End Property

Public Property Get Button3() As Boolean
Button3 = mcButton3
End Property

Private Sub cmdButton1_Click()
With Me

mcCButton1 = True
.Hide
End With
End Sub

Private Sub cmdButton2_Click()
With Me

mcCButton2 = True
.Hide
End With
End Sub

Private Sub cmdButton3_Click()
With Me

mcCButton3 = True
.Hide
End With
End Sub

Private Sub UserForm_Activate()
mcButton1 = False
mcButton2 = False
mcButton3 = False
End Sub


In the form calling module

With UserForm1

.Show
If .Button1 Then

'do something
ElseIf .Button2 Then

'do something else
ElseIf .Button3 Then

'do something other else
End If
End With
 

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