Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
'On Error' within 'For' loop | Excel Programming | |||
Help required with a simple Loop | Excel Programming | |||
Problem with 'For' loop execution [VBA,Excel XP] | Excel Programming | |||
Excel VBA code required (for.......next loop) | Excel Programming | |||
For....Next loop code required | Excel Programming |