Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
MSN MSN is offline
external usenet poster
 
Posts: 2
Default Conver text to number in VBA

Hi,

How to convert "1995" (text) to 1995 (number) in VBA?

Thanks.
Sam


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to conver the number "10" to spell "Ten" Dignesh Excel Discussion (Misc queries) 2 August 7th 09 07:52 AM
excell cell there is figure Rs.10545,, how to conver in words SANTOSH New Users to Excel 1 October 19th 08 03:35 PM
I want to convert to CVS(,) from excel, I can't conver to text ? John Excel Discussion (Misc queries) 0 May 2nd 07 07:27 PM
CONVER CSV CUSTOMER DATA TO A CUSTOM INDIVI CUSTOMER PRICE SHEET brunod Excel Discussion (Misc queries) 1 July 7th 06 07:01 PM
Conver Numbers to Log 10 Fishfan New Users to Excel 1 May 10th 05 04:20 PM


All times are GMT +1. The time now is 10:48 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"