Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Textbox focus lost | Excel Programming | |||
TextBox focus | Excel Programming | |||
TextBox Focus | Excel Programming | |||
event which occurs when a TextBox receives focus | Excel Programming | |||
Which textbox have focus? | Excel Programming |