Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / November 2007

Tip: Looking for answers? Try searching our database.

Make checked the check box using Loop

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Gopra - 01 Nov 2007 08:51 GMT
Is it possible to check all the check box by using loop instead of type all
(like checkbox1.value = true
checkbox2.value = true)
Jean-Guy Marcil - 01 Nov 2007 16:45 GMT
Gopra was telling us:
Gopra nous racontait que :

> 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
'_______________________________________

Signature

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org


Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.