ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   TextBox focus (https://www.excelbanter.com/excel-programming/300308-re-textbox-focus.html)

Tom Ogilvy

TextBox focus
 
Sheet1.TextBox1.Activate

--
Regards,
Tom Ogilvy

"René" wrote in message
...
Hi!

I'm validating a TextBox, if there is no data, then a MsgBox pop up

telling the user what they need to do.

What I would like to happen after they click the "OK" of the MsgBox is the

cursor be placed in the TextBox.

Here is part of my code:

If Sheet1.TextBox1.Value = "" Then
MsgBox "Please enter a name"
Sheet1.TextBox1.SetFocus
End If

Thanks in advance





All times are GMT +1. The time now is 06:50 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com