Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default TextBox Focus

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

End Sub

Worked fine for me in Excel 2000.

I don't know what fires the code, where it is located, or what version of
Excel you are using, but as I said, there is nothing inherently wrong with
the code suggested.

--
Regards,
Tom Ogilvy

"ené" wrote in message
...
Hi every one!

Thanks Tom for your help, but it did not work. I did exactly what you

suggested.

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

This is the error message:

Run-time error '1004':

Activate method of OLEOobject class failed

Thanks in advance to all!!!



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Textbox focus lost Stift[_25_] Excel Programming 7 June 7th 04 09:58 AM
TextBox focus Tom Ogilvy Excel Programming 0 June 3rd 04 03:17 PM
TextBox Focus John Wilson Excel Programming 6 January 16th 04 09:59 PM
event which occurs when a TextBox receives focus Mikhail Excel Programming 2 October 7th 03 02:27 PM
Which textbox have focus? Tom Ogilvy Excel Programming 0 August 27th 03 03:12 PM


All times are GMT +1. The time now is 01:36 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"