Restrict values in userform boxes

Kriptik

New Member
Joined
Jan 20, 2005
Messages
39
I have a userform for auditing doctor performance based on an existing tool. I have 12 criteria that all need to be marked either 0,1 or 2. I know how to do this in excel using data validation but how do I it in a userform. I'm new to this and the form I have developed works but I cant guarantee the auditors will put in the right values.

Thank you in advance
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Try this:-
Code:
Private [COLOR="Navy"]Sub[/COLOR] TextBox1_KeyPress(ByVal KeyAscii [COLOR="Navy"]As[/COLOR] MSForms.ReturnInteger)
 KeyAscii = KeyAscii * -CLng(Chr(KeyAscii) Like "[0-2]")
 TextBox1 = Left(KeyAscii, 0)
[COLOR="Navy"]End[/COLOR] [COLOR="Navy"]Sub[/COLOR]
Regards Mick
 
Upvote 0

Forum statistics

Threads
1,224,600
Messages
6,179,836
Members
452,947
Latest member
Gerry_F

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top