Sam Hamels
New Member
- Joined
- Mar 20, 2018
- Messages
- 49
The following code works perfectly to replace the values in a range of cells with the rounded versions.
As an example, I use a very small range [A1:C5] and rounding to 2 decimal points.
However, this code is rather slow when executed on a big range.
In my case, the range is [B4:AC8763], which is about 250.000 cells.
Running the above code takes about 25 seconds (!) on my modern laptop.
Is there any way I can achieve the same result, but significantly faster?
As an example, I use a very small range [A1:C5] and rounding to 2 decimal points.
Code:
Sub Round_range()
Application.ScreenUpdating = False
For Each cell In [A1:C5]
cell.Value = WorksheetFunction.Round(cell.Value, 2)
Next cell
Application.ScreenUpdating = True
End Sub
However, this code is rather slow when executed on a big range.
In my case, the range is [B4:AC8763], which is about 250.000 cells.
Running the above code takes about 25 seconds (!) on my modern laptop.
Is there any way I can achieve the same result, but significantly faster?
Last edited: