Excel: Formulas to absolute references

Sub convertAllSheetFormulasToAbsolute()

Dim oCell As Range

With ActiveSheet

  For Each oCell In .Cells.SpecialCells(Type:=xlCellTypeFormulas)

   oCell.Formula = Application.ConvertFormula(oCell.Formula, xlA1, xlA1, xlAbsolute)

  Next

End With

End Sub

 

 

Sub Formulas_To_AbsoluteReference()

Dim oCell As Range

With Selection

  For Each oCell In .Cells.SpecialCells(Type:=xlCellTypeFormulas)

   oCell.Formula = Application.ConvertFormula(oCell.Formula, xlA1, xlA1, xlAbsolute)

  Next

End With

End Sub

 

Sub Formulas_To_LockRowNumber_RelColumnLetter()

 Dim oCell As Range

 With Selection

  For Each oCell In .Cells.SpecialCells(Type:=xlCellTypeFormulas)

   oCell.Formula = Application.ConvertFormula(oCell.Formula, xlA1, xlA1, xlAbsRowRelColumn)

  Next

 End With

End Sub

 

 

Sub FormulasTo_LockColLetter_RelRowNum()

 Dim oCell As Range

 With Selection

  For Each oCell In .Cells.SpecialCells(Type:=xlCellTypeFormulas)

   oCell.Formula = Application.ConvertFormula(oCell.Formula, xlA1, xlA1, xlRelRowAbsColumn)

  Next

 End With

End Sub

 

 

Sub FormulasTo_AllRelative_Reference()

 Dim oCell As Range

 With Selection

  For Each oCell In .Cells.SpecialCells(Type:=xlCellTypeFormulas)

   oCell.Formula = Application.ConvertFormula(oCell.Formula, xlA1, xlA1, xlRelative)

  Next

 End With

End Sub