Re: Optionbutton variables to check which button has been selected
Quote from royUK;678117
You are unloading the form before the code can run. Try this
Option Explicit
Private Sub CommandButton1_Click()
Select Case True
Case Me.OptionButton1
QC_for_ChaseRecons_7753
Case OptionButton2
QC_for_ChaseRecons_7761
Case OptionButton3
QC_for_ChaseRecons_3003 ""
Case Else
End Select
Unload Me
End Sub
Display More
[TABLE="width: 627"]
[tr]
[td]
Hi Sir,
[/td]
[/tr]
[tr]
[td][/td]
[/tr]
[tr]
[td]
Thanks for attending my post and helping me.
[/td]
[/tr]
[tr]
[td][/td]
[/tr]
[tr]
[td]
"Yes" its working fine for option buttons that is named ChaseRecons userform but when we choose directly 1. QC_for_ChaseRecons_3003 or 2. QC_for_ChaseRecons_7753 or 3. QC_for_ChaseRecons_7761 and press run then also its working fine but skipping two userforms I.e password & Userform1 but this should not be run without skipping any of the userforms.
[/td]
[/tr]
[tr]
[td][/td]
[/tr]
[tr]
[td]
Normally when we open the excel sheet and press alt+f8 we get a window, in that window if we select directly any one among the three process its working and skipping two userform as said above.
And i have not set any code or variables to named userform1, its just unloding and moving to next code, please help me to set the variable to userform1 as well.
My need is that if we directly select and run the macro should not be ran.
[/td]
[/tr]
[tr]
[td]
Hope you will understand my request.
[/td]
[/tr]
[tr]
[td][/td]
[/tr]
[tr]
[td]
I hereby request your goodselves to kindly help me on the same.
[/td]
[/tr]
[tr]
[td][/td]
[/tr]
[tr]
[td]
Note:- Sure i will donate as much as i can.
[/td]
[/tr]
[tr]
[td][/td]
[/tr]
[tr]
[td]
Regards,
[/td]
[/tr]
[tr]
[td]
Rahaman
[/td]
[/tr]
[/TABLE]