View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jacob Skaria Jacob Skaria is offline
external usenet poster
 
Posts: 8,520
Default Multi controls code

Try the below piece of code...which will filter down to the same type of
controls..

Dim Ctrl As MSForms.Control
For Each Ctrl In UserForm1.Controls
If TypeOf Ctrl Is MSForms.CheckBox Then
' do something for all checkboxes
End If
Next Ctrl

--
Jacob


"אלי" wrote:

Hi!

I have on a userform 8 spreadsheet activeX controls, and I want all of them
to do the same thing. Do I have to write the same code 8 times or there is a
way to do it only once. The names a spreadsheet1, 2......8.

Thanks in advance

Eli