Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Word
application.errors
conversions
docmanagement
drawing.graphics
formatting.longdocs
international
internet.assistant
mail
mailmerge.fields
menustoolbars
newusers
numbering
oleinterop
pagelayout
printingfonts
setup.networking
spelling.grammar
tables
vba.addins
vba.beginners
vba.customization
vba.general
vba.userforms
web.authoring
word6-7macros
word97vba
  
 
date: Thu, 1 Nov 2007 00:51:00 -0700,    group: microsoft.public.word.vba.customization        back       


Make checked the check box using Loop   
Is it possible to check all the check box by using loop instead of type all 
(like checkbox1.value = true
checkbox2.value = true)
date: Thu, 1 Nov 2007 00:51:00 -0700   author:   Gopra

Re: Make checked the check box using Loop   
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
'_______________________________________

-- 

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org
date: Thu, 1 Nov 2007 11:45:05 -0400   author:   Jean-Guy Marcil DontEvenTry@NoSpam

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us