Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 2 of 2

Thread: Error when deleting rows.

  1. #1
    New Member
    Join Date
    Apr 2002
    Posts
    1
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I have a spreadsheet in which each row has some home brewed functions and each row is identical. A formula in one cell refers to to a cell in the row above.

    I am trying to create a macro which will simplify the process of deleting a row, as when I delete a row, the formula (in the row below) produces an @REF! error as the row above is no longer there. That is OK as I can copy the formula from another cell and paste it in.

    So this is the problem: When I create the macro it works fine, however, when I run it it produces the @REF! error. I tried tracking down the problem by stepping through the macro, and what appears to be happening is that the macro, after deleting the row, jumps to the functions, runs through them all, goes to back to the top of the functions and stops before copying and pasting the formula.

    The macro works fine on a spreadsheet with no functions. I have tried many things, such as deleting the functions from the rows I am trying to remove, but with no success. At this point I am spinning my wheels and would be extremely grateful for any clues as to the solution,

    Thanks,

    Ian Fraser

  2. #2
    Board Regular
    Join Date
    Mar 2002
    Location
    Cincinnati, Ohio, USA
    Posts
    6,824
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Maybe you could disable calculation at the beginning of you macro as such:


    ActiveSheet.Calculate = False



    Then re-enable calculation at the end of your macro as such:


    ActiveSheet.Calculate = True



    Tom

    P.S.

    You may as well disable events too!


    Application.EnableEvents = False



    Don't forget to re-enable at the end of your procedure...


    Application.EnableEvents = True


    [ This Message was edited by: TsTom on 2002-04-28 08:24 ]

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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