Hi,
I am trying to find userform control based on their name (exp: txtInput01 [Textbox], cboInput01 [combobox])
Like Userform1.contorls.name = txtInput01 then do something.
Thanks,
KC
Hi,
I am trying to find userform control based on their name (exp: txtInput01 [Textbox], cboInput01 [combobox])
Like Userform1.contorls.name = txtInput01 then do something.
Thanks,
KC
![]()
Please Login or Register to view this content.
Last edited by humdingaling; 06-29-2017 at 09:57 PM. Reason: formatting
If you are satisfied with the solution(s) provided, please mark your thread as Solved.
Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.
Hi humdingaling,
Thanks for your feedback. I incorporate the code into my project and modify accordingly to suit my need.
Do you think the code below can further optimize it?
Description on code below:
I have 2 userform (U1 and U2). Both of them are having same controls and same name as well (exp. U1.txtInput01 and U2.txtInput02)
Each of the userform have approximate 50 controls (label and frame) and all are having same Control Name
so code below will help me to emulate U1 content and setting to U2 form
Thanks,![]()
Please Login or Register to view this content.
KC
not every control has the same things you can change
ie textbox doesnt have caption it has text instead
so what do you want to do then>
also changes made in code arent generally permanently saved...only in the running of the code![]()
Please Login or Register to view this content.
ie if you set textbox1.text = "Test" from "blank" in the code...when the code finishes it returns to "blank"
Hi humdingaling,
Your idea was great. It help my code's length reduce by ~60%.
Thanks,
KC
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks