ExcelBanter

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

Tom Ogilvy

TextBox Focus
 
That answered one question out of 3.

if you are executing the code from a command button , change the
takefocusonclick property to false

if from any other activeX control try

Private Sub ControlName_Click()
ActiveCell.Activate
If Sheet1.TextBox1.Value = "" Then
MsgBox "Please enter a name"
Sheet1.TextBox1.Activate
End If
End Sub

--
Regards,
Tom Ogilvy

"René" wrote in message
...
Thanks again Tom, the version of Excel that I'm using is 97.





All times are GMT +1. The time now is 10:45 PM.

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