View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default "For Each" Statement error...

One more...

Dim ctrl As Control
For Each ctrl In Me.Controls
If TypeOf ctrl Is MSForms.CheckBox Then
ctrl.Object.Value = True
End If
Next ctrl



pmguerra wrote:

Hi

I'm having a little trouble with "For each"...

I want to use this statement to know the number of checkboxes in my
form, for example...

It's kind of:

dim check as checkbox

For each check in my_form

i=i+1

Next check

But it doesn't work... I don't know if I'm using the statement
correctly...

--
pmguerra
------------------------------------------------------------------------
pmguerra's Profile: http://www.excelforum.com/member.php...o&userid=14986
View this thread: http://www.excelforum.com/showthread...hreadid=560898


--

Dave Peterson