I have the following code to loop through controls on a userform multipage to find a specific button.
Is there a way to directly reference a control without looping through them all?
Many Thanks![]()
Please Login or Register to view this content.
I have the following code to loop through controls on a userform multipage to find a specific button.
Is there a way to directly reference a control without looping through them all?
Many Thanks![]()
Please Login or Register to view this content.
Normally you loop through the controls collection because you have controls with a name that includes an index, such as Button1 Button2 etc, and VBA does not support control arrays.
If you know the name of the control you can just reference it.
Why are you looping?
I don't know the code to reference it directly, that's why i was using the loop. I have tried a few variations but couldn't get it to work. Can you tell me what the code is?
Many Thanks
You haven't told us what the name is.
Assume its cmdForward then
or![]()
Please Login or Register to view this content.
![]()
Please Login or Register to view this content.
Thats perfect, many thanks.
There are 20 or so pages each with a button called 0Forward (0 being the multipage number).
Here is the code i used:
Once again, thanks for your help![]()
Please Login or Register to view this content.
![]()
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks