• Home
  • Blog
  • Resume
  • Contact
  • Projects
  • Gallery
  • Amit’s Resume
  • About Nagpur
KEEP IN TOUCH

Change references

Feb01
2006
2 Comments Written by admin

If you want to change references of a formula, you could toggle F4 key inside the formula to change the references from Absolute, Column Absolute Row Absolute or all relative.

Although, if you have to change references from a range, you can use these two options
1. Download ASAP utilities, because it’s worth it, they have more than 300 utilities which are used many times.

2. Use this code.

Sub Change_refs()
‘This sub will change references of formula to different options shown by a userform
‘This code will not run without the userform
On Error GoTo Change_refs_Error
Load frmRefType
frmRefType.Show
Dim IPFormula As String, OPFormula As String, c As Range
Dim RefStyle As XlReferenceStyle
With frmRefType
    If .obAbs Then
        RefStyle = xlAbsolute
    ElseIf .obCAbs Then
        RefStyle = xlRelRowAbsColumn
    ElseIf .obRAbs Then
        RefStyle = xlAbsRowRelColumn
    ElseIf .obRel Then
        RefStyle = xlRelative
    Else
        Exit Sub
    End If
End With
Application.ScreenUpdating = False
For Each c In Selection
    If IsEmpty(c) Then GoTo Nextc
    IPFormula = c.Formula
    OPFormula = Application.ConvertFormula( _
        Formula:=IPFormula, _
        fromReferenceStyle:=xlA1, _
        toReferenceStyle:=xlA1, ToAbsolute:=RefStyle)
    c.Formula = OPFormula
Nextc:
Next c
Application.ScreenUpdating = True
Unload frmRefType
   On Error GoTo 0
   Exit Sub
Change_refs_Error:
    If Not Application.ScreenUpdating Then Application.ScreenUpdating = True
    Unload frmRefType
    MsgBox “Error ” & Err.Number & ” (” & Err.Description & “) in procedure Change_refs”
End Sub

You’ll have to download the add-in to make this code run. You can edit the Addin just by opening it in VBA. Here is the Addin. If you install this add in it will create a button “Change References”

Related posts:

  1. Change the creation date of a workbook
  2. Save HTML files from one folder to Excel files in another folder
  3. Stack Columns of Data on one column
  4. Add footer to all the worksheets in a workbook
  5. Send File Path-Email via Groupwise
Posted in Uncategorized - Tagged Number Err, VBA
SHARE THIS Twitter Facebook Delicious StumbleUpon E-mail
« Trendline coefficients and regression analysis
» MOD Function and Mod Operator Return Different Values

2 Comments

  1. Melanie's Gravatar Melanie
    February 23, 2006 at 10:08 am | Permalink

    hi, I’m trying to download your addin, but it’s not working. could you help, please? :)

    thanks.

  2. Ashutosh's Gravatar Ashutosh
    July 11, 2006 at 5:26 pm | Permalink

    Right click and save as this file and from Excel open it thru Tools>Add-Ins

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

*

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">

Tags

Access Alt F8 Books boxplot cells charts count cursor dashboard data mining dbase design error excel excel functions export filter flip LaTex MS query Number Err ODBC pipes Press Alt F11 Public Sub python R random numbers Range Cells report scripting software sparklines SQL SQL server stack columns statistics stemming string tag cloud text mining UDF VBA visualization wildcard

Network

View Ashutosh Nandeshwar's profile on LinkedIn

Recent Comments

  • W. McNabb on The search key was not found in any record in Access
  • Manuel on The search key was not found in any record in Access
  • Wendy Naples on The search key was not found in any record in Access
  • larry on Access Export to Excel (2007)
  • Betty Chou on Projects

Related Posts

  1. Change the creation date of a workbook
  2. Save HTML files from one folder to Excel files in another folder
  3. Stack Columns of Data on one column
  4. Add footer to all the worksheets in a workbook
  5. Send File Path-Email via Groupwise

EvoLve theme by Blogatize  •  Powered by WordPress nandeshwar.info