LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default "Reading" Excel VBA checkboxes and their captions

I have a loop that calls this once for each of 44 sales
reps names, passing the name of the rep to this function
as an argument. There are 44 corresponding checkboxes
("ctl") which I want to "read" (i.e. determine whether
they're checked or not) and output a "true" or "false"
depending on whether the user checked that particular
rep's checkbox.


I have the following code:


Function isDesiredRep(repName As String) As Boolean
'loop through all rep names and read their respective
checkbox;
' if the rep's checkbox is checked, return TRUE
Dim ctl As Control
For Each ctl In mainForm.repsNames_frame.Controls
If ctl.Value = True And ctl.Caption = repName Then
isDesiredRep = True
Else
isDesiredRep = False
End If
Next
End Function



On the line that begins with "If ctl.value", I am getting
the error "Object doesn't support this property or method."

What am I doing wrong, please?

Thanks,
Eliezer
 
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
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
How do I stop graphs reading zero in Excel from cells with ""? ThomasStudd Charts and Charting in Excel 2 September 28th 06 04:11 PM
How do I stop graphs reading zero in Excel from cells with ""? ThomasStudd Excel Worksheet Functions 3 September 27th 06 07:29 PM
Why does my excel file have an extension reading ".xls:1"? Steve Irmin Excel Discussion (Misc queries) 2 January 24th 06 11:21 PM
reading variable "from" and "to" ZIP codes Dan Wasser[_2_] Excel Programming 2 January 9th 04 01:36 PM


All times are GMT +1. The time now is 01:58 AM.

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

About Us

"It's about Microsoft Excel"