"%" character

  • Thread starter Thread starter Wavequation
  • Start date Start date
W

Wavequation

I am using the following code:

Val(strValue)

where strValue = "0.1%"

I am getting a type mismatch error.. what does the "%" character do to a
string?
 
As you found, Val() can't handle strings that are formatted with characters
such as % or $. Divide the value by 100, i.e. use:
0.001

In what context do you need such a value entered? If it is an unbound text
box, set its Format property to Percent, and it will be understood correctly
as a numeric value.
 
Back
Top