Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
other
informationbridge
office.intranets
office.misc
office.setup
office.xml
officeupdate
onenote
photodraw.discussion
powerpoint
producer
proj.standard&server
project
project.developer
project.pro_and_serve
project.server
project.vba
project2000
publisher
publisher.prepress
publisher.programming
publisher.webdesign
visio
visio.createshapes
visio.database.modeling
visio.dev.diagrams
visio.dev.shapesheet
visio.dev.vba
visio.dev.vc
visio.developer
visio.general
visio.installation
visio.printing
visio.software.modeling
visio.troubleshoot
  
 
date: 31 Jan 2006 17:06:59 -0800,    group: microsoft.public.project.vba        back       


userform with many buttons   
i have a userform with 60 commandbuttons and need some code to loop
through them all, making the ones without captions set to
..visible=false
can't seem to get variables defined properly.

any assistance greatly apprecieted =)
date: 31 Jan 2006 17:06:59 -0800   author:   diddi

Re: userform with many buttons   
Try:

Private Sub UserForm_Click()
Dim O As Object
    For Each O In UserForm1.Controls
        If O.Caption = "" Then
            O.Visible = False
        End If
    Next
End Sub

-- 

Rod Gill
Project MVP
Visit www.msproject-systems.com for Project Companion Tools and more


"diddi"  wrote in message 
news:1138756019.652228.213440@o13g2000cwo.googlegroups.com...
>i have a userform with 60 commandbuttons and need some code to loop
> through them all, making the ones without captions set to
> .visible=false
> can't seem to get variables defined properly.
>
> any assistance greatly apprecieted =)
>
date: Wed, 1 Feb 2006 14:37:10 +1300   author:   Rod Gill rod AT project-systems DOT co DOT nz

Google
 
Web ureader.com


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