Sometimes we may need to restrict users from entering anything besides numbers in a textbox. The following code can achieve this:
Option ExplicitPrivate strClipboardText As StringPrivate Sub txtNumberBox_KeyPress(KeyAscii As Integer) If (KeyAscii <= Asc(