I have VBA code to enter in AnnualSalary but am stuck in validating so not to have Text or Enter Key error out - so user has to re-enter.
AnnualSalary = InputBox("Annual Salary? Example: 65000", "Enter"
A Do While AnnualSalary <= 0
Loop
Range("D6".Value = (Val(AnnualSalary))
The "Val" works to translate a string to show $0.00 in the cell - but I want to have the user have to re-enter if a "string" or "ENTER" key is used.
I tried the following below the AnnualSalary = InputBox("Annual Salary? Example: 65000", "Enter" --- but it is not working. I also tried adding: Dim AnnualSalary As Integer at the top.
If AnnualSalary < Asc("0" Or AnnualSalary > Asc("9" Then
' AnnualSalary = 0
' End If
' Const ENTER As Integer = 13 ' the ANSI value of the Enter Key
' If AnnualSalary = ENTER Then
' AnnualSallary = 0
' End If
What am I missing here?
AnnualSalary = InputBox("Annual Salary? Example: 65000", "Enter"
A Do While AnnualSalary <= 0
Loop
Range("D6".Value = (Val(AnnualSalary))
The "Val" works to translate a string to show $0.00 in the cell - but I want to have the user have to re-enter if a "string" or "ENTER" key is used.
I tried the following below the AnnualSalary = InputBox("Annual Salary? Example: 65000", "Enter" --- but it is not working. I also tried adding: Dim AnnualSalary As Integer at the top.
If AnnualSalary < Asc("0" Or AnnualSalary > Asc("9" Then
' AnnualSalary = 0
' End If
' Const ENTER As Integer = 13 ' the ANSI value of the Enter Key
' If AnnualSalary = ENTER Then
' AnnualSallary = 0
' End If
What am I missing here?