Clearing controls on a Userform (1 Viewer)

browny

Registered User.
Local time
Tomorrow, 03:44
Joined
Mar 7, 2006
Messages
32
Hi all
I have created an input userform in Excel using the form creator in the VBA Editor. The form has a number of controls on it, Text and combo boxes, Option buttons, and a number of check boxes, in total, around 100 controls.

A function I require is the ability to clear the form, ie reset the controls to their original values. I do not initialise the form on opening as the initial control values have been set in the control properties. Does anyone know if there is code that I can use that will reset the values without me having to write reset code for each control.

Another function that would be a nice to have is that when a control has the focus, its back colour changes, when the control loses the focus the back colour reverts to the original colour. Again I can code this for each control but would like to know if there is a procedure/s that you can call that gives you the active control so you only need to write 2 procedures for the form as a whole.

Any help or advice appreciated.

Regards
Craig
 
Last edited:

Users who are viewing this thread

Top Bottom