Looping through control

G

Guest

Hi,

I think I may have asked this before, but I can't find the post.

I have a userform with a mixture of control on it. I want to set the visible
property of all the images to false

How do I loop through the controls and make only the images invisible? My
current
code makes all the controls invisible.

Many thanks in advance.
Libby x
 
B

Bob Phillips

Libby,

Here is some code that will work from within the userform module

Dim ctl As Control

For Each ctl In Me.Controls
If TypeOf ctl Is Image Then
ctl.Visible = True
Else
ctl.Visible = False
End If
Next ctl



--

HTH

RP
(remove nothere from the email address if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top