G
Gordon Bentley-Mix
The VBA help says the Val function "[r]eturns the numbers contained in a
string as a numeric value of appropriate type." Does this mean that the data
type of the returned value will automatically converted to the data type of
the variable that's calling the function?
For example, in the following contruction
Dim myValue as Long
Dim myString as String
myString = "123 Main Street"
myValue = Val(myString)
will Val return "123" but will it be returned as a Long or do I need to use
CLng to convert it? I know I can just be sloppy and let VBA force the
conversion, but I would prefer to be precise.
--
Cheers!
Gordon
Uninvited email contact will be marked as SPAM and ignored. Please post all
follow-ups to the newsgroup.
string as a numeric value of appropriate type." Does this mean that the data
type of the returned value will automatically converted to the data type of
the variable that's calling the function?
For example, in the following contruction
Dim myValue as Long
Dim myString as String
myString = "123 Main Street"
myValue = Val(myString)
will Val return "123" but will it be returned as a Long or do I need to use
CLng to convert it? I know I can just be sloppy and let VBA force the
conversion, but I would prefer to be precise.
--
Cheers!
Gordon
Uninvited email contact will be marked as SPAM and ignored. Please post all
follow-ups to the newsgroup.