I have a large number of textboxes on a userform. During data entry I am performing two types of validation, validating that the text entered in every textbox is a number and then the value entered in each textbox falls within a specified range, the range for each textbox is different.
For each textbox I have used a BeforeUpdate. The first action is to test if the value entered is a number (this is common to all textbox BeforeUpdates). If the value entered is a number the value is checked to determine if it is within the acceptable range (the range is unique for each textbox). If the value is outside the range the focus returns to the textbox ok due to the use of Cancel = True. However, if the value entered is not numeric the focus does not return. How can I ensure that focus returns to the textbox if the value is not numeric?
Bookmarks