Option Explicit
Sub AdjustFormulaRefType()
Dim rRng As Range
On Error Resume Next
For Each rRng In Application.Intersect(Selection, Selection.SpecialCells(xlCellTypeFormulas))
Err.Clear
If Range(rRng.Address).HasFormula = False Then
MsgBox "There are no formulas within the selection", 64
Exit Sub
Else
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Application.EnableEvents = False
If Err.Number <> 0 Then GoTo ErrExit:
Range(rRng.Address).Formula = Application.ConvertFormula _
(Range(rRng.Address).Formula, 1, 1, xlAbsolute)
End If
Next rRng
ErrExit:
Application.EnableEvents = True
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
End Sub
|