View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Loop for checkboxes

Rob,

This is the sort of thing that you want

Dim ctl As MSForms.Control

For Each ctl In Me.Controls
If TypeName(ctl) = "CheckBox" Then
If ctl.Value < True Then
ctl.Visible = False
End If
End If
Next ctl


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Rob" wrote in message
...
I'd like to know how to do this on a Userform.
-----Original Message-----
What sort of checkboxes, userform, forms toolbar, or

control toolbar?

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Matt" wrote in

message
...
Is it possible in VBA to do a typical loop? Such as

this. Basically I
want checkboxes 2-5 to be invisible if checkbox 1 is not

checked. I've
found that it will not allow me to put in the "x + 1".

Thanks. Matt.

const x = 2
If checkbox1.value = false
do while x < 5
checkbox(x).visible = false
x + 1
loop
end if



.