Hi,
1st time on here so bear with me. I have written the following code, to ensure only numerical values are entered in a VBA form input box;
Private Sub OperatorNumber_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean)
If Not (IsNumeric(OperatorNumber.Value) = True) Then
Call OperatorNumberShowError("Numbers Only!")
Cancel = True
Else
End If
End Sub
This works fine, but what I have found is that certain special characters, such as: "+" can be entered which doesn't work for what I am trying to achieve.
I would like to write a function, that I can refer to using the following code, that will allow only numbers and decimals, but exclude all other characters, this is where I am struggling, please is someone able to help?
Else
If Not (IsOnlyNumbersAndDecimals(OperatorNumber.Value) = False) Then
Call OperatorNumberShowError("No Special Characters!")
Cancel = True
End If
Thanks
1st time on here so bear with me. I have written the following code, to ensure only numerical values are entered in a VBA form input box;
Private Sub OperatorNumber_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean)
If Not (IsNumeric(OperatorNumber.Value) = True) Then
Call OperatorNumberShowError("Numbers Only!")
Cancel = True
Else
End If
End Sub
This works fine, but what I have found is that certain special characters, such as: "+" can be entered which doesn't work for what I am trying to achieve.
I would like to write a function, that I can refer to using the following code, that will allow only numbers and decimals, but exclude all other characters, this is where I am struggling, please is someone able to help?
Else
If Not (IsOnlyNumbersAndDecimals(OperatorNumber.Value) = False) Then
Call OperatorNumberShowError("No Special Characters!")
Cancel = True
End If
Thanks