Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default Hiding/Showing OptionButtons on a UserForm

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 cant 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---



--
RyGuy
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,117
Default Hiding/Showing OptionButtons on a UserForm

could you post the code? i can't tell from where these subs are being
called - are they _change subs, command button subs, _click subs?
i know you said it's long, but...........
susan


On Jul 31, 9:16 am, ryguy7272
wrote:
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---

--
RyGuy



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default Hiding/Showing OptionButtons on a UserForm

The code below works fine. What I am trying to do is get the UserForm to
accept OptionButton19 or OptionButton34, and then move to the next UserForm.
For some reason, when I click on OptionButton19 or OptionButton34, I get the
message, €œPlease select a Product Line!!€



If OptionButton35 = False And _
OptionButton36 = False And _
OptionButton37 = False And _
OptionButton38 = False And _
OptionButton39 = False And _
OptionButton40 = False And _
OptionButton41 = False And _
OptionButton42 = False And _
OptionButton43 = False And _
OptionButton46 = False And _
OptionButton45 = False And _
OptionButton44 = False And _
OptionButton47 = False And _
OptionButton59 = False And _
OptionButton60 = False Then
MsgBox "Please select a Product Line!!"
Exit Sub
End If
Etc, etc, etc€¦

Below is another example...lots of cosd similar to this...
If OptionButton51 = False And _
OptionButton52 = False And _
OptionButton53 = False And _
OptionButton54 = False And _
OptionButton55 = False And _
OptionButton56 = False And _
OptionButton57 = False And _
OptionButton58 = False Then
MsgBox "Please select a Transaction Type!!"
Exit Sub
End If


I'd greatly appreciate any help/insight!!



"Susan" wrote:

could you post the code? i can't tell from where these subs are being
called - are they _change subs, command button subs, _click subs?
i know you said it's long, but...........
susan


On Jul 31, 9:16 am, ryguy7272
wrote:
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---

--
RyGuy




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,117
Default Hiding/Showing OptionButtons on a UserForm

ok......... i'm really bad at visualizing stuff without seeing it, so
if it's not confidential data feel free to send it along & i'll take a
look at it.

bogen(secondword)excel(at symbol)aol(dot symbol)com

remove the words in parentheses and add the @ and .

in the interim........ take OptionButton 35-60. are they in a frame?
if so, only one can be selected, no matter how many there are.

rather than going through all the "false" convolutions, maybe you
should just focus on the two "true" ones.

if optionbutton19.value = true then
do your stuff
end if

then you can loop through all the other option buttons with the
message box.
hope that helps (a little, at least!).
susan




On Aug 1, 4:32 pm, ryguy7272
wrote:
The code below works fine. What I am trying to do is get the UserForm to
accept OptionButton19 or OptionButton34, and then move to the next UserForm.
For some reason, when I click on OptionButton19 or OptionButton34, I get the
message, "Please select a Product Line!!"

If OptionButton35 = False And _
OptionButton36 = False And _
OptionButton37 = False And _
OptionButton38 = False And _
OptionButton39 = False And _
OptionButton40 = False And _
OptionButton41 = False And _
OptionButton42 = False And _
OptionButton43 = False And _
OptionButton46 = False And _
OptionButton45 = False And _
OptionButton44 = False And _
OptionButton47 = False And _
OptionButton59 = False And _
OptionButton60 = False Then
MsgBox "Please select a Product Line!!"
Exit Sub
End If
Etc, etc, etc...

Below is another example...lots of cosd similar to this...
If OptionButton51 = False And _
OptionButton52 = False And _
OptionButton53 = False And _
OptionButton54 = False And _
OptionButton55 = False And _
OptionButton56 = False And _
OptionButton57 = False And _
OptionButton58 = False Then
MsgBox "Please select a Transaction Type!!"
Exit Sub
End If

I'd greatly appreciate any help/insight!!



"Susan" wrote:
could you post the code? i can't tell from where these subs are being
called - are they _change subs, command button subs, _click subs?
i know you said it's long, but...........
susan


On Jul 31, 9:16 am, ryguy7272
wrote:
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---


--
RyGuy- Hide quoted text -


- Show quoted text -



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default Hiding/Showing OptionButtons on a UserForm

That did it! Through a combination of your tips, and my fiddling, I got it
to work. Thanks so much.
Ryan--


"Susan" wrote:

ok......... i'm really bad at visualizing stuff without seeing it, so
if it's not confidential data feel free to send it along & i'll take a
look at it.

bogen(secondword)excel(at symbol)aol(dot symbol)com

remove the words in parentheses and add the @ and .

in the interim........ take OptionButton 35-60. are they in a frame?
if so, only one can be selected, no matter how many there are.

rather than going through all the "false" convolutions, maybe you
should just focus on the two "true" ones.

if optionbutton19.value = true then
do your stuff
end if

then you can loop through all the other option buttons with the
message box.
hope that helps (a little, at least!).
susan




On Aug 1, 4:32 pm, ryguy7272
wrote:
The code below works fine. What I am trying to do is get the UserForm to
accept OptionButton19 or OptionButton34, and then move to the next UserForm.
For some reason, when I click on OptionButton19 or OptionButton34, I get the
message, "Please select a Product Line!!"

If OptionButton35 = False And _
OptionButton36 = False And _
OptionButton37 = False And _
OptionButton38 = False And _
OptionButton39 = False And _
OptionButton40 = False And _
OptionButton41 = False And _
OptionButton42 = False And _
OptionButton43 = False And _
OptionButton46 = False And _
OptionButton45 = False And _
OptionButton44 = False And _
OptionButton47 = False And _
OptionButton59 = False And _
OptionButton60 = False Then
MsgBox "Please select a Product Line!!"
Exit Sub
End If
Etc, etc, etc...

Below is another example...lots of cosd similar to this...
If OptionButton51 = False And _
OptionButton52 = False And _
OptionButton53 = False And _
OptionButton54 = False And _
OptionButton55 = False And _
OptionButton56 = False And _
OptionButton57 = False And _
OptionButton58 = False Then
MsgBox "Please select a Transaction Type!!"
Exit Sub
End If

I'd greatly appreciate any help/insight!!



"Susan" wrote:
could you post the code? i can't tell from where these subs are being
called - are they _change subs, command button subs, _click subs?
i know you said it's long, but...........
susan


On Jul 31, 9:16 am, ryguy7272
wrote:
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---


--
RyGuy- Hide quoted text -


- Show quoted text -






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,117
Default Hiding/Showing OptionButtons on a UserForm

great!
:)
susan


On Aug 2, 9:30 am, ryguy7272
wrote:
That did it! Through a combination of your tips, and my fiddling, I got it
to work. Thanks so much.
Ryan--



"Susan" wrote:
ok......... i'm really bad at visualizing stuff without seeing it, so
if it's not confidential data feel free to send it along & i'll take a
look at it.


bogen(secondword)excel(at symbol)aol(dot symbol)com


remove the words in parentheses and add the @ and .


in the interim........ take OptionButton 35-60. are they in a frame?
if so, only one can be selected, no matter how many there are.


rather than going through all the "false" convolutions, maybe you
should just focus on the two "true" ones.


if optionbutton19.value = true then
do your stuff
end if


then you can loop through all the other option buttons with the
message box.
hope that helps (a little, at least!).
susan


On Aug 1, 4:32 pm, ryguy7272
wrote:
The code below works fine. What I am trying to do is get the UserForm to
accept OptionButton19 or OptionButton34, and then move to the next UserForm.
For some reason, when I click on OptionButton19 or OptionButton34, I get the
message, "Please select a Product Line!!"


If OptionButton35 = False And _
OptionButton36 = False And _
OptionButton37 = False And _
OptionButton38 = False And _
OptionButton39 = False And _
OptionButton40 = False And _
OptionButton41 = False And _
OptionButton42 = False And _
OptionButton43 = False And _
OptionButton46 = False And _
OptionButton45 = False And _
OptionButton44 = False And _
OptionButton47 = False And _
OptionButton59 = False And _
OptionButton60 = False Then
MsgBox "Please select a Product Line!!"
Exit Sub
End If
Etc, etc, etc...


Below is another example...lots of cosd similar to this...
If OptionButton51 = False And _
OptionButton52 = False And _
OptionButton53 = False And _
OptionButton54 = False And _
OptionButton55 = False And _
OptionButton56 = False And _
OptionButton57 = False And _
OptionButton58 = False Then
MsgBox "Please select a Transaction Type!!"
Exit Sub
End If


I'd greatly appreciate any help/insight!!


"Susan" wrote:
could you post the code? i can't tell from where these subs are being
called - are they _change subs, command button subs, _click subs?
i know you said it's long, but...........
susan


On Jul 31, 9:16 am, ryguy7272
wrote:
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---


--
RyGuy- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
UserForm OptionButtons Horatio J. Bilge, Jr. Excel Discussion (Misc queries) 3 October 4th 07 07:52 PM
Showing/Hiding shapes Ferris[_2_] Excel Programming 5 April 2nd 07 10:37 PM
CommandButtons and OptionButtons on Userform Mike Excel Programming 9 March 21st 07 02:44 AM
userforms showing and hiding Laurin[_11_] Excel Programming 4 December 20th 05 06:07 PM
Need help creating a userform with optionbuttons TB[_2_] Excel Programming 2 July 21st 03 02:16 PM


All times are GMT +1. The time now is 02:51 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"