View Single Post
  #14   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default application worksheetfunctions fail

In the vba help index, I typed val and got:
Val Function


Returns the numbers contained in a string as a numeric value of appropriate
type.

Syntax

Val(string)

The required string argument is any valid string expression.

Remarks

The Val function stops reading the string at the first character it can't
recognize as part of a number. Symbols and characters that are often
considered parts of numeric values, such as dollar signs and commas, are not
recognized. However, the function recognizes the radix prefixes &O (for
octal) and &H (for hexadecimal). Blanks, tabs, and linefeed characters are
stripped from the argument.

The following returns the value 1615198:

Val(" 1615 198th Street N.E.")
In the code below, Val returns the decimal value -1 for the hexadecimal
value shown:

Val("&HFFFF")
Note The Val function recognizes only the period (.) as a valid decimal
separator. When different decimal separators are used, as in international
applications, use CDbl instead to convert a string to a number.


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Sybmathics" wrote in message
...
Don Guillett schreef:
If a vba solution is available do NOT use a worksheet function.

date use dateserial
value use Val("1000") * 3


Don,

the dateserial sugggestion did the job.

via the help menu i found the instruction on how to use it. (same as in
Excel)

Strangely though, there was no help on val.

VBA Help doesn't seem to be as accurate as Excel Help.

Thanks for your time and suggestions.

Sybolt