+ Reply to Thread
Results 1 to 6 of 6

Delete Row causes #Ref w/absolute cell ref

  1. #1
    Registered User
    Join Date
    02-24-2007
    Posts
    18

    Question Delete Row causes #Ref w/absolute cell ref

    I have two worksheets. One contains data and the other uses formulas to perform certain actions based on what is in the cells on the other sheet. However, even though the formulas use absolute cell references, i.e. Sheet1!$A$1, when a row is deleted, the formula becomes invalid with a #REF error.

    Example:
    Sheet 1
    a1 = 1
    a2 = 2
    a3 = 3

    Sheet 2
    a1 contains =Sheet1!$A$1
    a2 contains =Sheet1!$A$2
    a3 contains =Sheet1!$A$3

    If I delete row 2 of Sheet 1, a #REF error occurs with the cell a2 on Sheet 2.

    I would expect Sheet 2 to have the following values after deletion:
    a1 = 1
    a2 = 3
    a3 = ""

    but instead, a2 gets a reference error and a3 gets changed to =Sheet1!$A$2.

    How can I get Excel to leave Sheet 2 cell content alone?

  2. #2
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Hi,
    instead of =Sheet1!$A$3 use

    =Offset(Sheet1!$A$1,2,0)

    etc

    hth
    ---
    Last edited by Cutter; 07-24-2012 at 12:55 PM. Reason: Removed whole post quote
    Si fractum non sit, noli id reficere.

  3. #3
    Registered User
    Join Date
    02-24-2007
    Posts
    18

    Thumbs up

    Thanks for the help. The Offset function worked for me. I had to use the ROW() function as the row offset as well to get a complete solution. Again, thanks!

  4. #4
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote Originally Posted by dgarris
    Thanks for the help. The Offset function worked for me. I had to use the ROW() function as the row offset as well to get a complete solution. Again, thanks!
    good to see a success, the Column() is also useful if you are using the Offset across the row as well as down the columns.

    Thanks for the feedback.
    ---

  5. #5
    Registered User
    Join Date
    07-24-2012
    Location
    chicago, usa
    MS-Off Ver
    Excel 2007
    Posts
    1

    Re: Delete Row causes #Ref w/absolute cell ref

    I have a formula that adds the values of two cells of the previous ROw, unfortunately, when trying offset, or Indirect, we always have a REF error when deleting 1 or more rows. Is there any way to fix this issue?

    here is the code...

    =SUM(A1:B1)

    After deleting i get the error #REF!
    Last edited by frits2012; 07-24-2012 at 10:47 AM.

  6. #6
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Delete Row causes #Ref w/absolute cell ref

    Hello frits2012, and welcome to the forum.

    Unfortunately you have inadvertently broken one of the forum rules. Please read the following and make the necessary change. Thanks.

    Your post does not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread. It makes sense to have a new thread for your question because a thread with numerous replies can be off putting & difficult to pick out relevant replies.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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