Murray Brown
asked on
Excel numbers not working
Hi
I have a spread that was downloaded from an accounting system, where
the amount column contains numbers like the following. Excel isn't seeing these
as numbers. What Excel function or method can I use to turn these into numbers?
-,100.00
4 368.81
I have a spread that was downloaded from an accounting system, where
the amount column contains numbers like the following. Excel isn't seeing these
as numbers. What Excel function or method can I use to turn these into numbers?
-,100.00
4 368.81
You could just use Replace to remove commas and spaces.
update column, lastrow and spreadsheet to your needs
Dim i As Long
Dim MyStr As String
Dim MyNewStr As String
lastrow = Sheets(1).Range("A" & Sheets(1).Rows.count).End(xlUp).Row
For i = 2 To lastrow
MyStr = Sheets(1).Range("A" & i).Value
MyNewStr = WorksheetFunction.Substitute(MyStr, "-", "")
MyNewStr = WorksheetFunction.Substitute(MyStr, ".", "")
MyNewStr = WorksheetFunction.Substitute(MyStr, ",", "")
MyNewStr = WorksheetFunction.Substitute(MyStr, " ", "")
Sheets(1).Range("A" & i).Value = MyNewStr
Next
ASKER
Thanks yahooooo. I ran the code and for some reason it didn't work. Please have a look at the attached spreadsheet, column R
Magic-Wand-GL-2010.xls
Magic-Wand-GL-2010.xls
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
Thanks very much for all the help