How can I keep selected a textbox every time I open the UserForm ?

fabber

New Member
Joined
Aug 31, 2010
Messages
2
Hello guys.
I have 1 UserForm with 2 TextBoxs and 1 CommandButton.
The CommandButton hides the UserForm. Every time I open the UserForm I would like to have textbox1 activated (I mean ready for typing in).
The problem is that it happens the first time only because when I use CommandButton on the userform (which hides the userform) and I open userform again the selection is on the CommandButton.
How can I keep selected textbox1 everytime I open the UserForm regardless whatever is the last operation I do on the UserForm?
I hope my question was clear.
Thankx

Fabber
 

jasonb75

Well-known Member
Joined
Dec 30, 2008
Messages
7,155
Office Version
2019
Platform
Windows
Assuming your userform is called "Form1", in the code to show the form add the line

Code:
Form1.TextBox1.SetFocus
 

Forum statistics

Threads
1,082,450
Messages
5,365,591
Members
400,840
Latest member
Fortune

Some videos you may like

This Week's Hot Topics

Top