vba convert string to a number if string is a number code example
Example: excel vba convert string to a number if string is a number
MsgBox Val(str)
'If string does not start with a numeric text value, Val() returns a zero.
MsgBox Val(str)
'If string does not start with a numeric text value, Val() returns a zero.