Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 151
Default Looping through control

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Looping through control

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)


"Libby" wrote in message
...
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
2007 Form Control/ActiveX Control font difference Nikko963 Excel Discussion (Misc queries) 0 April 15th 09 04:21 PM
Problem: Control Toolbox Control resizes when clicked Ed Excel Programming 1 July 27th 05 07:55 AM
Looping through controls on a MultiPage control Paul Martin Excel Programming 3 April 26th 05 05:08 AM
Set Focus Problem for textbox control on multipage control ExcelDeveloperSPR Excel Programming 1 July 16th 04 08:54 PM
Calendar Control: Can't exit design mode because control can't be created Rone Excel Programming 0 May 24th 04 04:01 PM


All times are GMT +1. The time now is 02:11 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"