+ Reply to Thread
Results 1 to 6 of 6

Losing References

  1. #1
    Registered User
    Join Date
    04-18-2011
    Location
    Virginia
    MS-Off Ver
    Excel 2010
    Posts
    8

    Question Losing References

    Hi, I am using two sheets.

    Sheet1 is the data - for example - A1 - a / A2 - b.
    Sheet2 is the reference - for example - sheet1!A1 / sheet1!A2

    if I insert a row between 1 and 2, it loses the reference. If I update the forms on sheet2, it works. If I delete the row added, it loses the reference too.

    So, how can I do to re-establish the references automatically, without update the forms?

    tks.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,917

    Re: Losing References

    What exactly are the formulas?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    04-18-2011
    Location
    Virginia
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Losing References

    Hi, Look at the sample below.

    Sheet1

    A1 = a
    A2 = b


    Sheet 2

    A1 =Sheet1!$A1
    A2 =Sheet2!$A2
    A3 =Sheet3!$A3
    A4 =Sheet4!$A4
    A5 =Sheet5!$A5

    So, suppose that you want to insert a row between 1 and 2 in the Sheet1. If you look at the Sheet2, the values are not updated. If you try to delete a row in the Sheet1, you lose the reference.

    The idea is to have updating the rows in the Sheet2, it doesnt matter if you insert or delete rows in the Sheet1.

    One way to solve it, it would be to create MACRO, but in this case, the user needs to click to update the spreadsheet. What I would like to do, it would be the spreadsheet being updated automatically.

    Is there a way?

    tks.

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,917

    Re: Losing References

    If you have Sheet1!A1 copied down a few times...
    =sheet1!A1
    =sheet1!A2
    =sheet1!A3
    =sheet1!A4
    and then insert a row after row 3 in sheet1, the result will look like this...
    =sheet1!A1
    =sheet1!A2
    =sheet1!A3
    =sheet1!A5

    How would excel know you wanted to reference (the new) row 4?

    The only way to keep those references, if you insert/delete rows, is to use INDIRECT()...
    =INDIRECT("Sheet1!A"&rows($1:1)
    where $1 would represent the row number your formulas start omn

  5. #5
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Losing References

    Your description is a bit hard to really understand but maybe one of these will do what you want. If you insert a row between Sheet1!A1 and Sheet1!A2 there will be a 0 or a blank cell between A and B dependant upon which formula you use. If you are to delete Sheet1!A1 Sheet2!A1 will be B.
    This will show 0 where there isn't a value
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    This will show a blank where there isn't a value.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    This workbook shows both formulae side by side for comparison
    Attached Files Attached Files
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  6. #6
    Valued Forum Contributor
    Join Date
    05-14-2012
    Location
    Unknown
    MS-Off Ver
    Unseen
    Posts
    429

    Re: Losing References

    You could also use INDEX:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    which is non volatile.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] References In Object Formulas Must Be External References To Worksheets Error
    By zanshin777 in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 12-28-2015, 07:40 AM
  2. Replies: 6
    Last Post: 06-02-2014, 01:40 PM
  3. [SOLVED] Moving a range one column to the right without losing the cell references
    By phook01 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 10-21-2013, 10:11 AM
  4. Replies: 0
    Last Post: 02-11-2013, 08:12 AM
  5. Deleting rows w/out losing references
    By \/\/avefor/\/\ in forum Excel General
    Replies: 8
    Last Post: 09-25-2008, 12:28 AM
  6. Replies: 0
    Last Post: 01-17-2006, 09:40 AM
  7. Replies: 2
    Last Post: 07-29-2005, 10:05 AM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1