Thread: Looping
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Chris Chris is offline
external usenet poster
 
Posts: 244
Default Looping

If you specifically need 1 to 30 use this

Dim Obj As OLEObjec
For Each Obj In Sheet1.OLEObject
If TypeOf Obj.Object Is MSForms.CheckBox The
If Len(Obj.Object.name) = 9 then x = Cint(Right(Obj.Object.name,1)
If Len(Obj.Object.name) = 10 then x = Cint(Right(Obj.Object.name,2))
If x = 1 And x < 31 Then Obj.Object.value = False
Next Ob

----- René wrote: ----

How can use a loop to do the following

Sheet1.CheckBox1.Value = Unchecke
Sheet1.CheckBox2.Value = Unchecke
Sheet1.CheckBox3.Value = Unchecke
Sheet1.CheckBox4.Value = Unchecke
Sheet1.CheckBox5.Value = Unchecke
Sheet1.CheckBox6.Value = Unchecke
Sheet1.CheckBox7.Value = Unchecke
Sheet1.CheckBox8.Value = Unchecke
Sheet1.CheckBox9.Value = Unchecke
Sheet1.CheckBox10.Value = Unchecke
Sheet1.CheckBox11.Value = Unchecke
Sheet1.CheckBox12.Value = Unchecke
Sheet1.CheckBox13.Value = Unchecke
Sheet1.CheckBox14.Value = Unchecke
Sheet1.CheckBox15.Value = Unchecke
Sheet1.CheckBox16.Value = Unchecke
Sheet1.CheckBox17.Value = Unchecke
Sheet1.CheckBox18.Value = Unchecke
Sheet1.CheckBox19.Value = Unchecke
Sheet1.CheckBox20.Value = Unchecke
Sheet1.CheckBox21.Value = Unchecke
Sheet1.CheckBox22.Value = Unchecke
Sheet1.CheckBox23.Value = Unchecke
Sheet1.CheckBox24.Value = Unchecke
Sheet1.CheckBox25.Value = Unchecke
Sheet1.CheckBox26.Value = Unchecke
Sheet1.CheckBox27.Value = Unchecke
Sheet1.CheckBox28.Value = Unchecke
Sheet1.CheckBox29.Value = Unchecke
Sheet1.CheckBox30.Value = Unchecke

Many thanks in advanc