Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm using 60 OptionButtons in a form. To initialize, I want all the
OptionButtons invisible. How can I index the OptionButtons with a For-Next Loop to accomplish this? I've tried numerous approaches with no luck at all... Plenty of error messages. Any help appreciated. Thanks, Fred |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Fred,
Try: '======================= Private Sub UserForm_Initialize() Dim oleObj As MSForms.OptionButton For Each oleObj In UserForm1.Controls If TypeOf oleObj Is MSForms.OptionButton Then oleObj.Visible = False End If Next End Sub '<<======================= --- Regards, Norman "Fred Russell" wrote in message ... I'm using 60 OptionButtons in a form. To initialize, I want all the OptionButtons invisible. How can I index the OptionButtons with a For-Next Loop to accomplish this? I've tried numerous approaches with no luck at all... Plenty of error messages. Any help appreciated. Thanks, Fred |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Probably best to declare the variable as Control
Dim oleObj As msforms.Control -- HTH Bob Phillips "Norman Jones" wrote in message ... Hi Fred, Try: '======================= Private Sub UserForm_Initialize() Dim oleObj As MSForms.OptionButton For Each oleObj In UserForm1.Controls If TypeOf oleObj Is MSForms.OptionButton Then oleObj.Visible = False End If Next End Sub '<<======================= --- Regards, Norman "Fred Russell" wrote in message ... I'm using 60 OptionButtons in a form. To initialize, I want all the OptionButtons invisible. How can I index the OptionButtons with a For-Next Loop to accomplish this? I've tried numerous approaches with no luck at all... Plenty of error messages. Any help appreciated. Thanks, Fred |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Bob,
Agreed! --- Regards, Norman "Bob Phillips" wrote in message ... Probably best to declare the variable as Control Dim oleObj As msforms.Control -- HTH Bob Phillips "Norman Jones" wrote in message ... Hi Fred, Try: '======================= Private Sub UserForm_Initialize() Dim oleObj As MSForms.OptionButton For Each oleObj In UserForm1.Controls If TypeOf oleObj Is MSForms.OptionButton Then oleObj.Visible = False End If Next End Sub '<<======================= --- Regards, Norman "Fred Russell" wrote in message ... I'm using 60 OptionButtons in a form. To initialize, I want all the OptionButtons invisible. How can I index the OptionButtons with a For-Next Loop to accomplish this? I've tried numerous approaches with no luck at all... Plenty of error messages. Any help appreciated. Thanks, Fred |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Norman and Bob, I really appreciate your help. Recommendation worked
just fine when using Norman's code with Bob's suggestion on the dimension statement. Dim oleObj As msforms.Control Best regards, Fred |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
optionbutton | Excel Programming | |||
OptionButton value | Excel Programming | |||
OptionButton | Excel Programming | |||
Better Way to Use OptionButton | Excel Programming | |||
which optionbutton is on | Excel Programming |