Round Function for Entire Sheet

  • Thread starter Thread starter mstjohn
  • Start date Start date
M

mstjohn

I have a sheet with approx 50 formulas that links to other workbooks and
worksheets. Does anyone know how to round the entire sheet without adding the
round function to every cell?
 
You could use this macro to add the ROUND function to formulas in place.

Sub RoundAdd()
Dim myStr As String
Dim cel As Range
For Each cel In Selection
If cel.HasFormula = True Then
If Not cel.Formula Like "=ROUND(*" Then
myStr = Right(cel.Formula, Len(cel.Formula) - 1)
cel.Value = "=ROUND(" & myStr & ",2)"
End If
End If
Next
End Sub


Gord Dibben MS Excel MVP
 
Back
Top