alexaronson
Active Member
- Joined
- Sep 30, 2005
- Messages
- 314
I have a large mass of data.
Some cells have values like this "8492".
Others have vlues like this "00009".
I have to get the cells to drop the leading zeros.
I have tried changing the format of the cells to numbers, but the zero's wont drop.
I know if I select the cell one at a time and hit the F2 key, the zero's magically disappear.
Due to the size of the data, I can't F2 every cell.
What I am looking for is a macro, that will go through a column of data, select the data, hit the F2 key, and then go to the next cell.
I created a macro that mimincs what I do manually and this is what I get.
So with that thought process I tried this:
Can anyone help?
Some cells have values like this "8492".
Others have vlues like this "00009".
I have to get the cells to drop the leading zeros.
I have tried changing the format of the cells to numbers, but the zero's wont drop.
I know if I select the cell one at a time and hit the F2 key, the zero's magically disappear.
Due to the size of the data, I can't F2 every cell.
What I am looking for is a macro, that will go through a column of data, select the data, hit the F2 key, and then go to the next cell.
I created a macro that mimincs what I do manually and this is what I get.
Code:
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 11/17/2005 by aaronso
'
'
ActiveCell.FormulaR1C1 = "26909"
Range("D279").Select
ActiveCell.FormulaR1C1 = "26910"
Range("D280").Select
ActiveCell.FormulaR1C1 = "27030"
Range("D281").Select
ActiveCell.FormulaR1C1 = "27033"
Range("D282").Select
ActiveCell.FormulaR1C1 = "28018"
Range("D283").Select
End Sub
So with that thought process I tried this:
Code:
Sub CleanZeros()
Application.ScreenUpdating = False
For j = 1 To 40000
ActiveCell.FormulaR1C1 = Row()
j = j + 1
Next
Application.ScreenUpdating = False
End Sub
Can anyone help?