Conver text to number in VBA
activecell.Numberformat = "General"
activecell.value = activecell.value
or if it is a variable
Dim sStr as String
Dim vVal as Variant
Dim dblVal as Double
sStr = "1995"
vVal = cdbl(sStr)
'or
dblVal = sStr
--
Regards,
Tom Ogilvy
MSN wrote in message
...
Hi,
How to convert "1995" (text) to 1995 (number) in VBA?
Thanks.
Sam
|