ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   change the reference type of multiple formulas (https://www.excelbanter.com/excel-discussion-misc-queries/180597-change-reference-type-multiple-formulas.html)

Derfel

change the reference type of multiple formulas
 
Can I change the cell reference type (absolute, relative etc.) for multiple
cells without manually adjusting each cell?

Gord Dibben

change the reference type of multiple formulas
 
By macro. Choose which type from the 4 below.

Sub Absolute_Both()
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

On Wed, 19 Mar 2008 09:15:01 -0700, Derfel
wrote:

Can I change the cell reference type (absolute, relative etc.) for multiple
cells without manually adjusting each cell?




All times are GMT +1. The time now is 04:36 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com