I am trying to remove all of the formulas from various sheets and just leave the values. I have tried to do this with VBA in a few different ways(below) but with each of them there are always some values that just come back as blank. Has anybody experienced this before?
VBA Code:
Dim rng As Range
For Each rng In ActiveSheet.UsedRange
If rng.HasFormula Then
rng.Formula = rng.Value
End If
Next rng
VBA Code:
Application.DisplayAlerts = False 'stops message box from alerting about pasting over values
Sheets(reportArray(0)(2)).Cells.Select
Selection.Copy
Sheets(reportArray(0)(2)).Range("A1").PasteSpecial Paste:=xlPasteValues
Application.DisplayAlerts = True 'turns alerts back on
VBA Code:
With ActiveSheet.UsedRange
.Value = .Value
End With