Jean-Pierre
New Member
- Joined
- Sep 15, 2009
- Messages
- 3
I need to round the result of a ( or several ) selected cell(s) wich already contains several figures wich I must keep. Exemple: 500+200+109 The cell display the value of 809. If I apply a round formula I will loose the info of what amounts where added. So I wrote the following code as a starting point but it is not working:
Sub arrondir()
Dim cell As Range
Dim myValue As Single
For Each cell In Selection
myValue = cell.Value
cell.Formula = "=MROUND(("myValue"),100)"
Next cell
End Sub
If i were to use the vba function, the answer would replace the amounts that were added and I dont want that.
Thank you for any suggestion.
Sub arrondir()
Dim cell As Range
Dim myValue As Single
For Each cell In Selection
myValue = cell.Value
cell.Formula = "=MROUND(("myValue"),100)"
Next cell
End Sub
If i were to use the vba function, the answer would replace the amounts that were added and I dont want that.
Thank you for any suggestion.