Computer Forum Forum Index
Register  FAQ Profile Log in to check your private messages Log in Register 

Make checked the check box using Loop

 
Post new topic   Reply to topic    Computer Forum Forum Index -> word vba customization
View previous topic :: View next topic  
Author Message
Gopra
Guest





PostPosted: Thu Nov 01, 2007 7:51 am    Post subject: Make checked the check box using Loop Reply with quote

Is it possible to check all the check box by using loop instead of type all
(like checkbox1.value = true
checkbox2.value = true)
Back to top
Google
Sponsor





PostPosted: Thu Nov 01, 2007 7:51 am    Post subject: Advertisement

Back to top
Jean-Guy Marcil
Guest





PostPosted: Thu Nov 01, 2007 3:45 pm    Post subject: Re: Make checked the check box using Loop Reply with quote

Gopra was telling us:
Gopra nous racontait que :

Quote:
Is it possible to check all the check box by using loop instead of
type all (like checkbox1.value = true
checkbox2.value = true)

This code will display a userform (originally called "UserForm1") with all
its checkboxes set to true. Just make sure you have a button with the
"Me.Hide" statement behind it.

'_______________________________________
Sub TestUserForm()

Dim frmTest As UserForm1
Dim i As Long

Set frmTest = New UserForm1

Load frmTest

With frmTest
For i = 0 To .Controls.Count - 1
If TypeOf .Controls(i) Is MSForms.CheckBox Then
.Controls(i).Value = True
End If
Next
.Show
'Other code...
End With

Unload frmTest

Set frmTest = Nothing

End Sub
'_______________________________________

--

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Computer Forum Forum Index -> word vba customization All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Computer Forum