Conver text to number in VBA

T

Tom Ogilvy

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top