Ark68
Well-known Member
- Joined
- Mar 23, 2004
- Messages
- 4,616
- Office Version
- 365
- 2016
- Platform
- Windows
I am trying to determine if a user inputted value (txt_freq) is a number or not using this code:
The line is throwing a "Type mismatch" error, rightly so as a mathematical function is being applied to a alphabetical variable. I'm assuming this is not how to catch this error?
Rich (BB code):
txt_freq = "dsadfdfs"
If IsError(txt_freq * 1) Then
freqval = False
MsgBox "Invalid frequency (Non numeric)"
Exit Do
End If
The line is throwing a "Type mismatch" error, rightly so as a mathematical function is being applied to a alphabetical variable. I'm assuming this is not how to catch this error?