Is there a way to refer to the active textbox in a user form, in a similar way to an active cell e.g. "activecell.value="X" " ?
Can you do something like activetextbox.value="x" ?
many thanks
Is there a way to refer to the active textbox in a user form, in a similar way to an active cell e.g. "activecell.value="X" " ?
Can you do something like activetextbox.value="x" ?
many thanks
May be
Please Login or Register to view this content.
< ----- Please click the little star * next to add reputation if my post helps you
Visit Forum : From Here
Please Login or Register to view this content.
Good Luck
I don't presume to know what I am doing, however, just like you, I too started somewhere...
One-day, One-problem at a time!!!
If you feel I have helped, please click on the star to left of post [Add Reputation]
Also....add a comment if you like!!!!
And remember...Mark Thread as Solved.
Excel Forum Rocks!!!
Thanks for the advice sintek , but this returns run time error 13 - type mismatch.
Perhaps I misunderstoodCan you do something like activetextbox.value="x"
FYI - The ActiveControl will return the control that is active if the UserForm is the only active container object. If it is not then ActiveControl will return the Active Container on the UserForm which could be a Frame, MultiPage, or WebBrowser and not the control in the container.
Sincerely,
Leith Ross
Remember To Do the Following....
1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.2. Thank those who have helped you by clicking the Star below the post.3. Please mark your post [SOLVED] if it has been answered satisfactorily.
Old Scottish Proverb...
Luathaid gu deanamh maille! (Rushing causes delays!)
@ Leith...True...I just misunderstood...Assumed OP was referring to Textbox which had focus...
Is there a way to refer to the active textbox in a user form,
Dear Leith, Thanks for the file, which works when there is only one text box,
when i add a second text box, and click on it to place the cursor in it, the command button doesnt put an "x" in it.
Please Login or Register to view this content.
Perhaps, this is what you want...
https://www.mrexcel.com/forum/excel-...box-focus.html
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks