Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
convert number to % using only custom number format challenge | Excel Discussion (Misc queries) | |||
how do I convert a number to number of years, months and days | Excel Worksheet Functions | |||
convert text-format number to number in excel 2000%3f | Excel Discussion (Misc queries) | |||
not able to convert text, or graphic number to regular number in e | Excel Worksheet Functions | |||
convert decimal number to time : convert 1,59 (minutes, dec) to m | Excel Discussion (Misc queries) |