Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ayo Ayo is offline
external usenet poster
 
Posts: 489
Default Working with GroupName in a control

I have 2 forms. On both forms I have option buttons. Form1 has 4
optionbuttons: Central, Northeast, South and West. Form2 has 4 Frames for
each region and in each frame I have between 10 to 20 markets.
My objective is: Whan I click on any of the region optionbuttons on form1,
I want to open form2 with only the region's frame enabled, along with all the
markets optionbuttons within the frame. At the same time, I want the other
three region frames and all their respective market optionbuttons to be
disabled.
So far this is where I am and I am stuck:

Private Sub optCentral_Click()
Dim ctl As Control
UserForm2.frmNortheast.Enabled = False
UserForm2.frmSouth.Enabled = False
UserForm2.frmWest.Enabled = False
Me.Hide
'currSheet.Range("B1").Select
For Each ctl In UserForm2.Controls
'if Typename(ctl)="OptionButton"
Next ctl
UserForm2.Show
End Sub

I don't know what my IF statement should include. Any help or ideas will be
appreciated.
Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ayo Ayo is offline
external usenet poster
 
Posts: 489
Default Working with GroupName in a control

Thanks . I figured it out:
Dim ctl As Control
UserForm2.frmNortheast.Enabled = False
UserForm2.frmSouth.Enabled = False
UserForm2.frmWest.Enabled = False
Me.Hide
currSheet.Range("B1").Select
For Each ctl In UserForm2.Controls
If TypeName(ctl) = "OptionButton" Then
If ctl.GroupName < optCentral.Caption Then
ctl.Enabled = False
End If
End If
Next ctl
UserForm2.Show
Application.ScreenUpdating = True

"Ayo" wrote:

I have 2 forms. On both forms I have option buttons. Form1 has 4
optionbuttons: Central, Northeast, South and West. Form2 has 4 Frames for
each region and in each frame I have between 10 to 20 markets.
My objective is: Whan I click on any of the region optionbuttons on form1,
I want to open form2 with only the region's frame enabled, along with all the
markets optionbuttons within the frame. At the same time, I want the other
three region frames and all their respective market optionbuttons to be
disabled.
So far this is where I am and I am stuck:

Private Sub optCentral_Click()
Dim ctl As Control
UserForm2.frmNortheast.Enabled = False
UserForm2.frmSouth.Enabled = False
UserForm2.frmWest.Enabled = False
Me.Hide
'currSheet.Range("B1").Select
For Each ctl In UserForm2.Controls
'if Typename(ctl)="OptionButton"
Next ctl
UserForm2.Show
End Sub

I don't know what my IF statement should include. Any help or ideas will be
appreciated.
Thanks

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
OptionButtons with same GroupName not working properly RyanH Excel Programming 3 June 24th 08 04:37 PM
Using GroupName Noemi Excel Programming 6 October 5th 06 02:40 AM
GroupName for OptionButton Shawn G. Excel Programming 3 July 6th 06 04:35 PM
How to referance a GroupName Garry[_7_] Excel Programming 3 October 5th 04 01:24 PM
GroupName Paul Excel Programming 2 December 4th 03 11:33 AM


All times are GMT +1. The time now is 11:12 PM.

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"