+ Reply to Thread
Results 1 to 9 of 9

Check Value above if different add row if same go to next row in range. If empty go to nex

  1. #1
    Forum Contributor
    Join Date
    06-28-2013
    Location
    Green Bay, WI
    MS-Off Ver
    Excel 2007
    Posts
    125

    Check Value above if different add row if same go to next row in range. If empty go to nex

    I am looking for a simple macro to check the value in the cell above it. If the value is equal/same do nothing and check the next row down. If the values are different I need to add a row. I will run this macro starting in Column A, then Column B, and then Column C. This will be used to simply add a space between differing data and keeping the same data in a group.

    Any help is appreciated.

    Spreadlover

  2. #2
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Check Value above if different add row if same go to next row in range. If empty go to

    Try

    Please Login or Register  to view this content.
    - Battle without fear gives no glory - Just try

  3. #3
    Forum Contributor
    Join Date
    06-28-2013
    Location
    Green Bay, WI
    MS-Off Ver
    Excel 2007
    Posts
    125

    Re: Check Value above if different add row if same go to next row in range. If empty go to

    It sort of worked, but the results won't do. It put an empty cell underneath all of the changes, but I need a whole empty row. All of the data in a row needs to stay intact. With just an empty cell being inserted, it left the original data scattered.

  4. #4
    Forum Contributor
    Join Date
    06-28-2013
    Location
    Green Bay, WI
    MS-Off Ver
    Excel 2007
    Posts
    125

    Re: Check Value above if different add row if same go to next row in range. If empty go to

    Here is an example of how the workbook would be set up and the expected results. Right now I just Sort the original data. Then I separate each different product by inserting a new row. Example Book.xlsx

  5. #5
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Check Value above if different add row if same go to next row in range. If empty go to

    Try next code
    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    06-28-2013
    Location
    Green Bay, WI
    MS-Off Ver
    Excel 2007
    Posts
    125

    Re: Check Value above if different add row if same go to next row in range. If empty go to

    It worked perfectly. Thank you very much. Now I will just have to try and figure out what it is you did.

  7. #7
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Check Value above if different add row if same go to next row in range. If empty go to

    Good, be free to ask details

  8. #8
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,607

    Re: Check Value above if different add row if same go to next row in range. If empty go to

    This should leave the blank row(s) as is if there any.
    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    06-28-2013
    Location
    Green Bay, WI
    MS-Off Ver
    Excel 2007
    Posts
    125

    Re: Check Value above if different add row if same go to next row in range. If empty go to

    Quote Originally Posted by jindon View Post
    This should leave the blank row(s) as is if there any.
    Please Login or Register  to view this content.

    This works as well Guru. Thank you.

+ 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. Check for empty range
    By gtmeloney in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-06-2009, 02:09 PM
  2. check if any cell in a dynamic range is empty
    By akabraha in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-30-2008, 04:13 PM
  3. [SOLVED] check for non-empty cells outside of a certain range
    By Abe in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-28-2006, 01:50 PM
  4. check for non-empty cells outside of a certain range
    By Abe in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-28-2006, 11:45 AM
  5. [SOLVED] Check for empty range in vba
    By Phil in forum Excel General
    Replies: 1
    Last Post: 04-28-2006, 05:10 PM

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