Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi fbagirov
You can use the Left function to test the first character You can try somthing like this If there are spaces in the cells you must use the trim function also Sub test() Dim cell As Range For Each cell In Range("A1:A10") If Left(cell.Value, 1) = "0" Then 'do nothing Else cell.Value = cell.Value * 1 End If Next cell End Sub -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "fbagirov" wrote in message ... I get a file with a column with numbers, where the cells are formated as text to preserve the first 0. I need to write a macro, that will select the column, and convert all cells to Number format. In addition, if there is a 0 in front of the number, I want it to keep the cell in the text format and go to the next cell. How do I write a code ? Thanks! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
To display number in text format in cells | New Users to Excel | |||
Converting numbers stored as text into number-format | Excel Programming | |||
converting general cells format to text | Excel Discussion (Misc queries) | |||
Converting number or text to a Date Format | New Users to Excel | |||
Keep number format after converting time to text | Excel Discussion (Misc queries) |