how to apply absolute cell referencing to multiple cells at once?

G

Guest

Hi, I know that you press F4 to change the cell referencing to absolute,
relative or mixed. But is there a way to select a range of cells to apply the
change all at once instead of having to choose each one and pressing F4 for
each. Any help is greatly appreciated! Thanks!
 
V

vezerid

I tried a simple formula:

=A1+A2+A3+A4

I selected all cell refs and pressed F4. All of the refs turned to
absolute. This is as far as changing the references within *a single
formula*. If you change the refs in a single formula and then copy
this cell, the copied cell refs will inherit the refs of the original
formula.

Does this help?
Kostis Vezerides
 
G

Gord Dibben

Here are a few macros for you to choose from.

Select your range of cells and run the 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)
End If
Next
End Sub

Sub AbsoluteRow()
Dim cell As Range
For Each cell In Selection
If cell.HasFormula Then
cell.Formula = Application.ConvertFormula _
(cell.Formula, xlA1, xlA1, xlAbsRowRelColumn)
Next
End Sub\

Sub AbsoluteCol()
Dim cell As Range
For Each cell In Selection
If cell.HasFormula Then
cell.Formula = Application.ConvertFormula _
(cell.Formula, xlA1, xlA1, xlRelRowAbsColumn)
Next
End Sub

Sub Relative()
Dim cell As Range
For Each cell In Selection
If cell.HasFormula Then
cell.Formula = Application.ConvertFormula _
(cell.Formula, xlA1, xlA1, xlRelative)
Next
End Sub


Gord Dibben MS 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