+ Reply to Thread
Results 1 to 5 of 5

Deleting rows without losing formulas

  1. #1
    John Davies
    Guest

    Deleting rows without losing formulas

    If I have a column of cells, say A1 to A15 with the values of A1=1,
    A2=A1+1,A3=A2+1 etc, then if I want to delete say row A6, row A7 will show
    the #REF! error. Is there a way to delete the row without losing the
    formula in the next row?

  2. #2
    Lionel H
    Guest

    RE: Deleting rows without losing formulas

    John,
    Instead of a2=A1+1, A3=A2+1 etc
    try a2=offset(a2,-1,0)+1, a3=offset(a3,-1,0)+1 etc
    regards,
    Lionel


    "John Davies" wrote:

    > If I have a column of cells, say A1 to A15 with the values of A1=1,
    > A2=A1+1,A3=A2+1 etc, then if I want to delete say row A6, row A7 will show
    > the #REF! error. Is there a way to delete the row without losing the
    > formula in the next row?


  3. #3
    John Davies
    Guest

    RE: Deleting rows without losing formulas

    Hi Lionel

    That works fine, but if I want to insert a line, the formula recalculates
    from the inserted point. Is there a way to delete and insert lines without
    losing the format.

    Also to be a pain, say that a column of cells has formulae that refer to a
    lookup table e.g. a2=vlookup(e12,data,5), a3=vlookup(e13,data,5) etc is there
    a way to delete and insert rows without losing the formulas in the next row.

    Thanks for your help


    "John Davies" wrote:

    > If I have a column of cells, say A1 to A15 with the values of A1=1,
    > A2=A1+1,A3=A2+1 etc, then if I want to delete say row A6, row A7 will show
    > the #REF! error. Is there a way to delete the row without losing the
    > formula in the next row?


  4. #4
    David McRitchie
    Guest

    Re: Deleting rows without losing formulas

    Hi John,
    See Insert a Row using a Macro to maintain formulas
    http://www.mvps.org/dmcritchie/excel/insrtrow.htm

    A VERY important aspect of this is changing your formula to use
    OFFSET so that you can insert, delete, sort rows.
    ---
    HTH,
    David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
    My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
    Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

    "John Davies" <[email protected]> wrote in message news:[email protected]...
    > Hi Lionel
    >
    > That works fine, but if I want to insert a line, the formula recalculates
    > from the inserted point. Is there a way to delete and insert lines without
    > losing the format.
    >
    > Also to be a pain, say that a column of cells has formulae that refer to a
    > lookup table e.g. a2=vlookup(e12,data,5), a3=vlookup(e13,data,5) etc is there
    > a way to delete and insert rows without losing the formulas in the next row.
    >
    > Thanks for your help
    >
    >
    > "John Davies" wrote:
    >
    > > If I have a column of cells, say A1 to A15 with the values of A1=1,
    > > A2=A1+1,A3=A2+1 etc, then if I want to delete say row A6, row A7 will show
    > > the #REF! error. Is there a way to delete the row without losing the
    > > formula in the next row?




  5. #5
    Dana DeLouis
    Guest

    Re: Deleting rows without losing formulas

    Another option, with some warnings, might be a named formula.

    ActiveWorkbook.Names.Add "Add1", "=R[-1]C+1"

    Now, in A2, enter the formula : =Add1
    and copy down.
    Just don't copy the sheet, as this will cause errors.

    --
    Dana DeLouis
    Win XP & Office 2003


    "John Davies" <[email protected]> wrote in message
    news:[email protected]...
    > If I have a column of cells, say A1 to A15 with the values of A1=1,
    > A2=A1+1,A3=A2+1 etc, then if I want to delete say row A6, row A7 will show
    > the #REF! error. Is there a way to delete the row without losing the
    > formula in the next row?




+ 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