Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
ControlButtons in a UserForm
I have the following code to get values from OptionButtons. The problem is,
seems that the code "TypeOf ctl is OptioinButton" always has value "False" even when ctl is an OptionButton. Could anybody tell me what did I do wrong in the code? Thanks a lot! ---------------------------------------------------------------------------- for each ctrl in form1 If TypeOf ctl Is OptionButton Then If ctl.Value = -1 Then Total = Total + CInt(ctl.Tag) End If testnumber = 1 Else End If next ------------------------------------------------------------------------------------ |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
ControlButtons in a UserForm
Sometimes you use ctrl. Sometimes you use ctl.
And whatever you use, try this: If TypeOf Ctrl Is msforms.OptionButton Then salut wrote: I have the following code to get values from OptionButtons. The problem is, seems that the code "TypeOf ctl is OptioinButton" always has value "False" even when ctl is an OptionButton. Could anybody tell me what did I do wrong in the code? Thanks a lot! ---------------------------------------------------------------------------- for each ctrl in form1 If TypeOf ctl Is OptionButton Then If ctl.Value = -1 Then Total = Total + CInt(ctl.Tag) End If testnumber = 1 Else End If next ------------------------------------------------------------------------------------ -- Dave Peterson |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
ControlButtons in a UserForm
for each ctrl in form1
If TypeOf ctl Is MSForms.OptionButton Then If ctl.Value = -1 Then Total = Total + CInt(ctl.Tag) End If testnumber = 1 Else End If next -- Regards, Tom Ogilvy "salut" wrote in message ... I have the following code to get values from OptionButtons. The problem is, seems that the code "TypeOf ctl is OptioinButton" always has value "False" even when ctl is an OptionButton. Could anybody tell me what did I do wrong in the code? Thanks a lot! -------------------------------------------------------------------------- -- for each ctrl in form1 If TypeOf ctl Is OptionButton Then If ctl.Value = -1 Then Total = Total + CInt(ctl.Tag) End If testnumber = 1 Else End If next -------------------------------------------------------------------------- ---------- |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
ControlButtons in a UserForm
That works. Thanks a lot!
"Dave Peterson" wrote: Sometimes you use ctrl. Sometimes you use ctl. And whatever you use, try this: If TypeOf Ctrl Is msforms.OptionButton Then salut wrote: I have the following code to get values from OptionButtons. The problem is, seems that the code "TypeOf ctl is OptioinButton" always has value "False" even when ctl is an OptionButton. Could anybody tell me what did I do wrong in the code? Thanks a lot! ---------------------------------------------------------------------------- for each ctrl in form1 If TypeOf ctl Is OptionButton Then If ctl.Value = -1 Then Total = Total + CInt(ctl.Tag) End If testnumber = 1 Else End If next ------------------------------------------------------------------------------------ -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Userform to enter values and shown in same userform in list | Excel Programming | |||
Looping procedure calls userform; how to exit loop (via userform button)? | Excel Programming | |||
Activating userform and filling it with data form row where userform is activate | Excel Programming | |||
Access from add_in userform to main template userform.... | Excel Programming | |||
Linking userform to userform in Excel 2003 | Excel Programming |