Looping through control

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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)
 
Back
Top