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

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
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,429
Messages
6,119,435
Members
448,898
Latest member
dukenia71

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