Check for Integer or Decimal value
Posted on 2008-11-06
Currently I have the following code for checking if a value is an Integer in one of my programs. This works great. However, I need to integrate the ability to validate for a decimal value as well. If decimal
then it should be valid as well. How can I adjust this code to check for both?
Dim chkForInt As Integer
chkForInt = Integer.Parse(Matrix.Columns.Item("NumEntry").Cells.Item(i).Specific.Value())
g_B1Connection.Application.MessageBox("Value entered is not an Integer: " & (Matrix.Columns.Item("NumEntry").Cells.Item(i).Specific.Value()), 1, "OK")
ErrFlag = "1"