Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Help required with 'FOR' Loop and Userforms

Hi All,

I remember a while back finding a website that told me how this was done,
but I can't seem to find reference anymore.

My problem is this - I have several userforms whereby i would like a "For
Each..." loop to acess so i can update the captions of each.

I know there seems to be issue with VBA finding all userforms in a project
when they have not been loaded/initialised, but I believe there is some
method that will allow me to do this without loading them. VBProjects object
will let me do this, but the problem is that the changes to the caption I
make using this method seem to end up permanent unlike if was to simply code
it like "userform1.caption = "abc"".

Permanancy is not an option because I have hard coded some info into each
userform and I am re-referencing the hard coded caption to then append other
info when the program first starts.

The caption will change once on startup, but the hardcoded captions must
stay when the project gets saved.

In short:

I require a method to go through each userform in a project without the
forms necessarily having been initialized and perform a function similar to
userform1.caption = ""

the vbproject object method isn't desirable.

If there is nobody able to help with this then through the vbproject way, I
am able to grab the name of the userform. Once I have this name, is there a
way to reference the userform like one can controls (EG
userform1.controls("textbox1") ??)

I tried the userforms method such as userforms(Object.name) but I kept
getting error. The object.name was the command that returned the userform
name, not the exact code as I don't have what I was working on exactly here
with me at the moment.

Any help is grealy appreciated and thank you in advance.

Regards,
Clint


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
'On Error' within 'For' loop flaterp Excel Programming 2 February 23rd 07 12:22 AM
Help required with a simple Loop Pedros[_3_] Excel Programming 10 July 27th 06 12:57 PM
Problem with 'For' loop execution [VBA,Excel XP] Angelos Markos Excel Programming 2 July 22nd 04 04:46 PM
Excel VBA code required (for.......next loop) uplink600[_2_] Excel Programming 5 May 18th 04 10:08 AM
For....Next loop code required uplink600 Excel Programming 2 May 12th 04 04:03 PM


All times are GMT +1. The time now is 04:08 PM.

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

About Us

"It's about Microsoft Excel"