MrExcel Publishing
Your One Stop for Excel Tips & Solutions

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.


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

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