Consulting

Results 1 to 5 of 5

Thread: Solved: converting relative addresses to absolute

  1. #1

    Solved: converting relative addresses to absolute

    Is there a macro to convert to absolute cell references an entire column of numbers that were originally keyed in as relative addresses? The column of numbers in question draws its data from another part of the workbook and the objective is to be able to paste and use that column in yet another part of the workbook without losing the data links

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    [vba]

    Sub Relative()
    Dim cell As Range
    For Each cell In Selection
    If cell.HasFormula Then
    cell.Formula = Application.ConvertFormula( _
    cell.Formula, xlA1, xlA1, xlRelative)
    End If
    Next
    End Sub
    [/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    Quote Originally Posted by xld
    [vba]

    Sub Relative()
    Dim cell As Range
    For Each cell In Selection
    If cell.HasFormula Then
    cell.Formula = Application.ConvertFormula( _
    cell.Formula, xlA1, xlA1, xlRelative)
    End If
    Next
    End Sub
    [/vba]
    Just highlight (select) the range with the relative address formulas and run the macro? (which I already tried without success).
    Last edited by K. Georgiadis; 03-25-2010 at 08:30 AM.

  4. #4
    VBAX Mentor
    Joined
    Jun 2004
    Posts
    363
    Location
    Change the
    xlRelative to xlAbsolute

  5. #5
    Quote Originally Posted by mbarron
    Change the
    xlRelative to xlAbsolute
    That was the answer! Thanks xld and mbarron.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •