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

Thread: IF...THEN...insert row

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

    Default

    Hi All

    Is there a way of inserting a row if the value in the cell below is > the value in the cell?
    ie if in A1 we have 5 and in A2 we have 7 I would need to insert a row below A1.

    I would prefer not to do this using VB.

    Many thanks

  2. #2
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Sydney, Australia
    Posts
    2,940
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi All

    Is there a way of inserting a row if the value in the cell below is > the value in the cell?
    ie if in A1 we have 5 and in A2 we have 7 I would need to insert a row below A1.

    I would prefer not to do this using VB.
    In a word, NO! A formula can't affect the Excel environment other than the cell it's in. This can only be done using VBA in the worksheet code module. If you want some sample code then please repost.

    regards,
    Dan

  3. #3
    Rest in Peace
    Join Date
    Feb 2002
    Posts
    1,582
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi KJ

    If you would prefer a manual approach then try this.

    In cell B1 put:

    =IF(A1>A2,1,"")

    Copy this down as far as needed. Now select all of Column B, push F5, Click "Special", check "Formulas" and uncheck all except "numbers" and Click Ok. Now go to Insert>Rows



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
  •