I have given a task of rounding a table with 119col*176Rows = 20944
(could be more) cells with double numbers. This comes from a measure machine with a lots of measurements and calculations.
My first Idea was to make a simple vba to update all cells in that range with the rounded number one by one in a loop, like shown in code below:.
BUT... this is Soooooooo Sloww that even Excel application crashes. I just need the same worksheet but values rounded to 3 decimals (the rounding numbers from Format Cells feature from Excel does get the job in this case, I need the numbers rounded and cut till third decimal in for each value)
Any workaround would be really appreciated guys
Sub Round_numbers_click()
Dim rng As Range
Dim rCell As Range
Dim valOriginal As Double
Dim valRounded As Double
Range("E15").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
Set rng = Application.Selection
For Each rCell In rng.Cells
valOriginal = col.Cells.Value
valRounded = Round(valOriginal, 3)
rCell.Value = valRounded
Next rCell
End Sub