+ Reply to Thread
Results 1 to 4 of 4

Macro to go row by row and insert row above based on criteria

  1. #1
    Registered User
    Join Date
    03-06-2012
    Location
    Calgary, Alberta
    MS-Off Ver
    Excel 2010
    Posts
    48

    Macro to go row by row and insert row above based on criteria

    So I'm hoping to code into my macro a part that will go row by row in column 1, and if the value in activecell=the cell above it does nothing, and if the values do not equal it adds a line.

    The row in question is ranks of customers, now in as values not formulas, and some customers have more than one listing so the column goes 1,2,3,4,4,4,5,6,6....

    my end goal is to make a macro that I can add to the current script that gets me to this list that will go down and insert a row to split the numbers into subgroups with a blank row after each group, than I'll have it run up and fill in sums for each group.

    Thoughts?

    Thanks in advance.
    Last edited by CDNcameron; 08-20-2013 at 05:20 PM.

  2. #2
    Forum Expert
    Join Date
    01-12-2007
    Location
    New Jersey
    Posts
    2,127

    Re: Macro to go row by row and insert row above based on criteria

    Maybe not what you are looking for, but have you looked into Excel's built-in SUBTOTAL feature. I posed the question to someone else, and included a sample Workbook, in case it interests you.

    See post 5 in this link: http://www.excelforum.com/excel-prog...944&viewfull=1

  3. #3
    Registered User
    Join Date
    03-06-2012
    Location
    Calgary, Alberta
    MS-Off Ver
    Excel 2010
    Posts
    48

    Re: Macro to go row by row and insert row above based on criteria

    Darn, was half way through writing an epic looping macro haha.

    I was able to macro in the subtotaling that Excel does, it doesn't bold the Subtotal which knowing my boss will be asked for, but I'll see what I can come up with.


    Thanks!

  4. #4
    Forum Expert
    Join Date
    01-12-2007
    Location
    New Jersey
    Posts
    2,127

    Re: Macro to go row by row and insert row above based on criteria

    Hi CDNcameron.

    Happy to help here. I know that bolding makes things nice; fortunately, a conditional format can easily border/bold SUBTOTALed rows.

+ 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. Replies: 7
    Last Post: 07-31-2014, 07:58 PM
  2. Insert columns based on a criteria (macro)
    By frank012345 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 10-24-2012, 07:25 PM
  3. [SOLVED] VB Macro to insert value in cell based on multiple criteria in a row
    By haleakala17 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-23-2012, 10:30 PM
  4. [SOLVED] Excel 07 - Macro to insert rows based on criteria
    By smic in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-18-2012, 09:58 AM
  5. Need help with insert row macro based on cell criteria
    By RAK in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-30-2009, 12:18 AM

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