Archive of Mr Excel Message Board


Back to Controls in Excel archive index
Back to archive home

Choose an object in a user form

Posted by Steve on June 05, 2001 7:18 PM
I have a simple userform with two buttons (ok and cancel) and two text boxes. The two text boxes are linked to two cells on the worksheet. I want the first text box to be chosen everytime I call the userform and both text boxes to be empty. Any help would be greatly appreciated.


Re: Choose an object in a user form

Posted by steve w on June 05, 2001 9:55 PM

To choose the first textbox, in the properties set the tab index to 0 for the first 1 for the second and so on. Now the textboxs should always come up how you see them in the design mode, unless you have code yo load data on the UserForm_Activate sub.
Not sure on this one give me some more info and I'd be happy to help.
steve w


Re: Choose an object in a user form

Posted by Ron on June 06, 2001 10:37 AM
On the UserForm Activate you could do something like this:
Textbox1.text=""
Textbox2.text=""
Textbox1.setfocus


This archive is from the original message board at www.MrExcel.com.
All contents © 1998-2004 MrExcel.com.
Visit our online store to buy searchable CD's with thousands of VBA and Excel answers.
Microsoft Excel is a registered trademark of the Microsoft Corporation.
MrExcel is a registered trademark of Tickling Keys, Inc.