Is it possible to set focus to an Excel 2003 worksheet text box? I tried this in the event handler code for a
check box and it produces the error message "Object doesn't support this property or method.
I was not able to find a VBA one-line-of-code solution to cause an Excel 2003
worksheet text box to take the focus.
A combination of steps produces the effect I was looking for, which include
activating the text box and causing its value to be temporarily changed to a
unique value, plus setting the SelStart property. A sample file is attached.
Private Sub CheckBox1_Click()
Dim tmp As String
If CheckBox1.Value Then 'text box to take focus
tmp = TextBox1.Text
TextBox1.Text = Now()
TextBox1.Text = tmp
TextBox1.SelStart = Len(TextBox1.Text)