Ark68
Well-known Member
- Joined
- Mar 23, 2004
- Messages
- 4,564
- Office Version
- 365
- 2016
- Platform
- Windows
I am trying to use this line of code as an option to trap a non-numeric entry into a userform combobox. If in my example, I enter "d" into the combobox field, where only whole numbers are allowed, it leaves me with a type mismatch error.
My thinking is CInt(starthr.value) will result in an error since non numeric numbers (ie letters and other characters) and the IsError will pick up the error. I think I may not be using IsError properly
Code:
If IsError(CInt(starthr.Value)) Then
My thinking is CInt(starthr.value) will result in an error since non numeric numbers (ie letters and other characters) and the IsError will pick up the error. I think I may not be using IsError properly