How to Convert Absolute Reference to Relative Reference

This post will guide you how to convert the cell reference from absolute reference to relative reference in excel. How to change the absolute reference of cells to relative using VBA macros in excel. How to change the reference to absolute reference to keep excel formulas while sorting cells that contain formulas.

Convert reference from absolute to relative

The first way is that you can press F4 key to change cell reference from absolute to relative. Just refer to the following steps:

1# select the cell that contains the reference you want to change.

convert absolute to relative1

2# select the reference of references that you want to convert

convert absolute to relative2

3# press F4 key three times.

convert absolute to relative3

Note: if you type a relative reference into formula box, then press F4, the reference will change to absolute. When you press F4 again, the reference changes to mixed type with the row fixed. So you need to press F4 key three times in the above steps.

You will see that the cell reference has been changed to relative reference.

Convert reference from relative to absolute

The cell references are set up as relative by default in Excel. It means that when you copy the cell contains formula to another cell, the cell reference will be changed automatically. If the original cell use the absolute reference, the formula can be kept without changed.

The simplest method is that you just need to press F4 key on the selected relative reference in formula box.

convert absolute to relative4

Convert reference from absolute to relative using VBA macro

x
How to Limit Data Entry in a Cell in Excel

You can also write an excel macro to quickly change the type of cell reference from absolute to relative. Refer to the following steps:

1# click on “Visual Basic” command under DEVELOPER Tab.

Get the position of the nth using excel vba1

2# then the “Visual Basic Editor” window will appear.

3# click “Insert” ->”Module” to create a new module

convert column number to letter3

4# paste the below VBA code into the code window. Then clicking “Save” button.

convert reference type111

Sub ConverReferenceType()
    On Error Resume Next
    Set myRange = Application.Selection
    Set myRange = Application.InputBox("Select one Range that you want to covert reference type:", "ConvertReferenceType", myRange.Address, Type:=8)
    Set myRange = myRange.SpecialCells(xlCellTypeFormulas)
     myIndex = Application.InputBox("Select a reference type from below list:" & Chr(13) & Chr(13) _
    & "Absolute = 1" & Chr(13) _
    & "Row absolute = 2" & Chr(13) _
    & "Column absolute = 3" & Chr(13) _
    & "Relative = 4", "ConvertReferenceType", 1, Type:=1)
    For Each R In myRange
       R.Formula = Application.ConvertFormula(R.Formula, XlReferenceStyle.xlA1, XlReferenceStyle.xlA1, myIndex)
    Next
End Sub

5# back to the current worksheet, then run the above excel macro.

convert absolute to relative6

convert absolute to relative6

convert absolute to relative6

 

Related Posts

VBA Macro For VLOOKUP From Another Sheet
vba macro for vlookup from another sheet1

In the previous post, you should know that how to fix or remove the #N/A error when using VLOOKUP formula to lookup value from another sheet. And this post will show you how to use VBA code to vlookup data ...

How To Insert Comments in Protected Worksheet in Excel
insert commetns in protected workshee3

This post will show you how to allow comments in a protected worksheet in Excel. You can easily to insert comments into cells in a normal worksheet in Excel, but if want to insert a comment in a worksheet that ...

How To Convert Text to Upper Cases(Using VBA) in Excel
convert text to upper cases1

This post will show you how to switch from lower case to upper case in Excel. and I am going to show you two different ways of converting text to upper cases using formula or VBA macro in Excel 2013,Excel ...

How To Hide Every Other Row in Excel (Using VBA)
hide every other row1

This post will show you how to hide alternate rows or columns in Excel or how to hide every third, fourth, fifth row or column in Excel. If you want to hide every other row in your current worksheet, how ...

How to Disable the Save As Prompt in Excel
disable save as prompt1

This post will show you how to use a VBA Macro to save an Excel file and overwrite any existing file without a prompt so that you are going to get the little window that says file already exists do ...

How to Count Cells that Contain even or odd numbers in Excel
count cells that contain even numbers5

This post will guide you how to count the number of cells that contain odd or even numbers within a range of cells using a formula in Excel 2013/2016.How do I count cells that contain odd numbers through the use ...

How to Count Cells that Contain negative Numbers in Excel

This post will guide you how to count the number of cells that contain negative numbers within a range of cells using a formula in Excel 2013/2016.You can count the number of negative numbers in your data using easy functions ...

How to Count Cells Are Not Blank or Empty in Excel
count non blank nonempty cells5

This post will guide you how to count cells that are not blank or empty in a given range cells using a formula in Excel 2013/2016.How do I count the number of cells that are not blank in a particular ...

How to Count Cells Not equal to X or Y in Excel
count cells not equals to x or y2

This post will guide you how to count the number of cells not equal to criteria X or Y in a given range cells using a formula in Excel 2013/2016.You can easily to count cells equal to or not equal ...

How to Count Cells Less Than a Specific Value in Excel
count cells lessr than5

This post will guide you how to count the number of cells less than a particular numeric value in a given range cells using a formula in Excel 2013/2016. How do I count cells that are less than a specific ...

Sidebar