Locking cell references

S

Shin

Is there a quick way I can lock a cell reference to a group of existing formulas without going through each one? I have thousands in a pre-exising file and I can't copy because the references have almost no pattern
 
G

Gord Dibben

Shin

Only through VBA macro.

Sub Absolute()
Dim cell As Range
For Each cell In Selection
If cell.HasFormula Then
cell.Formula = Application.ConvertFormula _
(cell.Formula, xlA1, xlA1, xlAbsolute)

''line above can be altered for varying references as below
''(cell.Formula, xlA1, xlA1, xlAbsRowRelColumn)
''(cell.Formula, xlA1, xlA1, xlRelRowAbsColumn)
''(cell.Formula, xlA1, xlA1, xlRelative)

End If
Next
End Sub


If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Gord Dibben Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top