Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default 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
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 to enter values and shown in same userform in list helmekki[_104_] Excel Programming 0 November 19th 05 03:23 PM
Looping procedure calls userform; how to exit loop (via userform button)? KR Excel Programming 6 July 27th 05 12:57 PM
Activating userform and filling it with data form row where userform is activate Marthijn Beusekom via OfficeKB.com[_2_] Excel Programming 3 May 6th 05 05:44 PM
Access from add_in userform to main template userform.... Ajit Excel Programming 1 November 18th 04 05:15 PM
Linking userform to userform in Excel 2003 missmelis01 Excel Programming 2 August 27th 04 08:07 PM


All times are GMT +1. The time now is 03:24 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"