Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Convert to Number


Column A of a varying number of rows have a 9 digit number leading wit
a Zero. Is there a way to remove the leading Zero in VBA. I ca
manually do this with the error checking wizard but I really need it t
do this within my code.

Example: 097894462 needs to be 97894462

ThXs,
Michae

--
Michael Wis
-----------------------------------------------------------------------
Michael Wise's Profile: http://www.excelforum.com/member.php...nfo&userid=699
View this thread: http://www.excelforum.com/showthread.php?threadid=38835

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Convert to Number


Michael this should do the job.

Just change the "For n = 1 to 10" to the required rows.

Sub Text_to_number()

For n = 1 To 10
If IsNumeric(Range("A" & n).Value) = True And Range("A" & n).Text _
< "" And Range("A" & n).HasFormula = False Then
Range("A" & n) = Val(Range("A" & n))
End If
Next

End Sub


--
Peter81
------------------------------------------------------------------------
Peter81's Profile: http://www.excelforum.com/member.php...o&userid=25353
View this thread: http://www.excelforum.com/showthread...hreadid=388353

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
convert number to % using only custom number format challenge Brotherharry Excel Discussion (Misc queries) 7 June 2nd 09 06:29 PM
how do I convert a number to number of years, months and days because Excel Worksheet Functions 2 October 12th 05 06:15 PM
convert text-format number to number in excel 2000%3f Larry Excel Discussion (Misc queries) 1 July 29th 05 08:18 PM
not able to convert text, or graphic number to regular number in e knutsenk Excel Worksheet Functions 1 April 2nd 05 08:41 AM
convert decimal number to time : convert 1,59 (minutes, dec) to m agenda9533 Excel Discussion (Misc queries) 8 January 20th 05 10:24 PM


All times are GMT +1. The time now is 12:23 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"