Hello,
I'm using a userform with 2 commandButtons ("Corp1"and "Corp2"), each one calls a different macro.
what I need it's declare the name of the commandButtons that was clicked as a public variable, because I need that word latter for the report header.
That's what I'm trying:
'in a general module'
Public Corps as Integer
'userform code'
Private Sub Corp1_Click()
Corps = Me.Corp1.Value
Call Report_Corp1
Unload Me
End
End Sub
Private Sub Corp2_Click()
Corps = Me.Corp2.Value
Call Report_Corp2
Unload Me
End
End Sub
but I get a type mismatch error, any help will be very appreciate
Thanks !!!
I'm using a userform with 2 commandButtons ("Corp1"and "Corp2"), each one calls a different macro.
what I need it's declare the name of the commandButtons that was clicked as a public variable, because I need that word latter for the report header.
That's what I'm trying:
'in a general module'
Public Corps as Integer
'userform code'
Private Sub Corp1_Click()
Corps = Me.Corp1.Value
Call Report_Corp1
Unload Me
End
End Sub
Private Sub Corp2_Click()
Corps = Me.Corp2.Value
Call Report_Corp2
Unload Me
End
End Sub
but I get a type mismatch error, any help will be very appreciate
Thanks !!!
Last edited: