View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default 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