View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Help: Multiple Checkboxes (, naming and visibility)

You could go through the controls collection:

Dim iCtr as long
for iCtr = 1 to 75
msgbox me.controls("checkbox" & ictr).value
next ictr
==============

Same thing with the visibility stuff
Dim NumberOfLines as long
dim iCtr as long

numberoflines = 8
for ictr = (numberoflines * 3 + 1) to 75
me.controls("checkbox" & ictr).visible = false
next ictr


Clinton M James wrote:

Hey gang,

I am having a hell of a time trying to work out how to fix my checkbox
needs.

I have a form (UserForm2) which I could now work out how to add checkboxes
to whilst the program was running so i added them to the user form itself.

I have 75 of them. I have overlapped them so I have 3 per line side by side
so people can choose any one or all of three options for each line.

Because the variable name for the objects is a straightforward variable, I
am now finding I cannot address each of these in the program such as I would
if I could in an arrange. Eg I have to address checkbox1 rather than
checkbox(1). The latter would be good in arrays, even if you couldaddress
the names such as Checkbox("Checkbox1")

So I a was wondering how i would address each out.

I need to make all checkboxes invisible except for ones that relate to lines
irequire. Lines are determined by how many lines of reference numbers are
put into userform1.

I also require each series of 3 checkboxes names to the reference number.
Therefore only every 3 hasit's label populated.

Anybody able to point me in the right direction?

I have read some things but it's lost me and I assume because my level of
programming is more intermediate than advanced and I come from the old basic
and pascal days, therefore objects aren't my forte.

Help is appreciated and thank you in advance.


--

Dave Peterson