UserForm textbox in focus with cursor. How?

vandan

New Member
Joined
Oct 8, 2002
Messages
4
This seems like a real beginner question but i have not been able to find the answer. i have a User form that has 1 textbox and 3 buttons. What i would like is that when the UserForm is launched that the textbox be in focus with the cursor ready. i can have the textbox in focus but the part that i can not do is have the cursor ready. i want to launch the UserForm and be able to start typing without having to select the textbox with the mouse.
thanks for you help,
Dan.
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Hi Vandan. Welcome to the board.

Try this

Private Sub Workbook_Open()
UserForm1.Show
UserForm1.TextBox1.SetFocus
End Sub
 
Upvote 0
the setfocus command is what i was using it will put the textbox in focus but it will not give me the cursor. any ideas?
Dan.
 
Upvote 0
i tried it in a new worksheet with a new userform and it does work it must be something that i am doing in the userform code to lose focus i will work on it thanks.
Dan.
 
Upvote 0

Forum statistics

Threads
1,214,411
Messages
6,119,356
Members
448,888
Latest member
Arle8907

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top