You could also try this:
Sub Cells_CleanUsedRange()
' "Cleans" contents of the used range on the active worksheet
Dim UsdRngValues As Variant
Dim UsdRngFormulas As Variant
Dim x As Long
Dim y As Long
With Application
.ScreenUpdating = False
With ActiveSheet
UsdRngValues = .UsedRange.Value
UsdRngFormulas = .UsedRange.Formula
For x = 1 To UBound(UsdRngValues, 2)
For y = 1 To UBound(UsdRngValues, 1)
If UsdRngValues(y, x) = UsdRngFormulas(y, x) Then
.Cells(y, x) = CleanString(UsdRngValues(y, x))
End If
Next y
Next x
.UsedRange.Columns.AutoFit
.UsedRange.Rows.AutoFit
End With
.ScreenUpdating = True
End With
End Sub
Bookmarks