Writing a Macro to add decimal

C

CindyW

I need to add a decimal to each number in a column of figures. For examples
7254
6523
8945
12546

I need to put a decimal point where the "thousands" would begin.
e.g:
7254 - 7.254

I want to write a macro that will go to the end of each figure, go back
three spaces and put a decimal there. Is this possible? How do I do it?
HELP!!!!!!!
 
K

Ken Wright

You don't, you simply put 1000 in an empty cell, copy that cell, select all
your data and do edit / paste special / divide, and then delete the 1000.

--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 97/00/02/03

------------------------------­------------------------------­----------------
It's easier to beg forgiveness than ask permission :)
------------------------------­------------------------------­----------------
 
D

Duke Carey

Does it have to be a macro?

You can put .001 into an empty cell, copy it, select all the numbers, and use
Edit->Paste Speical->Values->Multiply



If they
 
D

dominicb

Good evening CindyW

Something like this would do it. It doesn't actually count back three
digits from the end, but divides the number by 1000 - the end result
should be the same. Just remember to highlght the ange you want to
affect before running it.

Sub Thousands()
For Each num In Selection
num.Formula = num.Formula / 1000
Next num
End Sub

HTH

DominicB
 
Top