+ Reply to Thread
Results 1 to 3 of 3

Macro to sort, then insert headers

  1. #1
    Registered User
    Join Date
    06-24-2013
    Location
    Manila
    MS-Off Ver
    Excel 2010
    Posts
    2

    Macro to sort, then insert headers

    Hi All,

    Hi All,

    I have a spreadsheet that would contain a hundreds of thousands of invoices. But to simplify, I have attached a sample file where the data is condensed and much smaller.

    To simplify matter, what I am trying to achieve is the following.:

    1.) Sort via amount, and then insert a row and a header, between the positive values and negative values. This will then produce 2 different tables. Then sort the resulting 2nd table, via the oldest to newest.

    2.) The resulting 1st table, will then have to be sorted under days overdue. ANd then do the same drill, insert a header, in between the positive and negative value.

    3.) each resulting table then had to be labeled accordingly.

    On the file, sheet 2 would show how I wish the file would look like. The formatting concerns, can be overlooked.
    I understand that I may be being a bit lazy trying to avoid doing these manually, but we're talking about hundreds of thousands of transactions which means I have to do this repeatedly for different customers.

    Thanks in advance for the help.

    Sample.xlsx
    Last edited by geekboy101; 07-10-2013 at 06:09 PM.

  2. #2
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Macro to sort, then insert headers

    Hi geekboy101

    Welcome to the Forum!

    This Code is in the attached. It appears to do as you require on your sample File. Let me know of issues...
    Please Login or Register  to view this content.
    Be patient, the Code will take a bit of time to run on
    hundreds of thousands of invoices
    Attached Files Attached Files
    Last edited by jaslake; 06-27-2013 at 06:14 PM.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  3. #3
    Registered User
    Join Date
    06-24-2013
    Location
    Manila
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Macro to sort, then insert headers

    This works perfectly. Exactly what I need. I just have to edit a bit to match the actual name on the sheets and on the headers or locations on my actual file.
    Hopefully I don't screw that up.

    I'll post the finished product here once done. Thanks again.

    P.S.
    I'm very patient, and I devised a lazy way to minimize the number of rows involved. I decided to just copy part of the report into a paste area in the macro file, and run the codes from there.

+ 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