I'm trying to make a macro that takes the selected cells, replace the "." with ",", then changes it to double, divides it by 2 and rounds it off.
Examples of cells:
0.910 1.000
For Each Cell In Selection
Cell.Value = Replace(Cell, ".", ",")
Cell = CDbl(Cell.Value)
Cell = Cell / 2
Cell = Round(Cell, 4)
Next Cell
I'm expecting to get:
0.4550 0.5000
The problem is that if I have a number greater than 1.0 it just removes the "." and doesn't replace it with anything and since the cells have 3 decimals, I suddenly get 1000 instead of 1.
So I get:
0.4550 500
Any suggestions of what goes wrong?