R
ryguy7272
Hello Experts!! I am trying to come up with a way for a UserForm to show
certain OptionButtons, and hide others. My code is below (some of it is cut
out; it is very long):
If OptionButton1 = True And CheckBox1 = True Then
OptionButton2.Visible = False
OptionButton3.Visible = False
OptionButton4.Visible = True
OptionButton5.Visible = True
OptionButton6.Visible = True
‘…etc., etc., etc.
End If
That part works fine, but here is the tricky part…
If OptionButton21 = False And _
OptionButton22 = False And _
OptionButton33 = False And _
OptionButton44 = False And _
OptionButton25 = False Then
MsgBox "Please select a Transaction Type!!"
Exit Sub
End If
‘…etc., etc., etc.
If OptionButton30 Then Cells(20, 2) = "MAP"
If OptionButton40 Then Cells(20, 2) = "CUST"
‘…etc., etc., etc.
When I click on OptionButton30 or OptionButton40 the message box pops up and
reads, Please select a Transaction Type!! I guess I just have to change the
order in which the code fires, but I can’t seem to figure out what that order
is. BTW, all of these OptionButtons are in the same Frame. Does that make a
difference? Any help would be greatly appreciated.
Cordially,
Ryan---
certain OptionButtons, and hide others. My code is below (some of it is cut
out; it is very long):
If OptionButton1 = True And CheckBox1 = True Then
OptionButton2.Visible = False
OptionButton3.Visible = False
OptionButton4.Visible = True
OptionButton5.Visible = True
OptionButton6.Visible = True
‘…etc., etc., etc.
End If
That part works fine, but here is the tricky part…
If OptionButton21 = False And _
OptionButton22 = False And _
OptionButton33 = False And _
OptionButton44 = False And _
OptionButton25 = False Then
MsgBox "Please select a Transaction Type!!"
Exit Sub
End If
‘…etc., etc., etc.
If OptionButton30 Then Cells(20, 2) = "MAP"
If OptionButton40 Then Cells(20, 2) = "CUST"
‘…etc., etc., etc.
When I click on OptionButton30 or OptionButton40 the message box pops up and
reads, Please select a Transaction Type!! I guess I just have to change the
order in which the code fires, but I can’t seem to figure out what that order
is. BTW, all of these OptionButtons are in the same Frame. Does that make a
difference? Any help would be greatly appreciated.
Cordially,
Ryan---