+ Reply to Thread
Results 1 to 20 of 20

Split invoice file in max 1000 line items

  1. #1
    Forum Contributor
    Join Date
    06-14-2013
    Location
    jk
    MS-Off Ver
    Excel 2007
    Posts
    326

    Split invoice file in max 1000 line items

    Hi,

    I want to ask the guru's for help since i am inexperienced enough to find this out by myself

    I have a file with multiple invoices (Invoiceno is in column E).
    For upload reasons in SAP, there can only be max 999 items in one sheet (to simply copy and paste from excel in SAP).

    So, this list has to be split in different sheets when the number of rows is >999.

    For example: if invoice 1 has 700 items and invoice 2 has 500 items, combined the total is 1200. But it should not take 299 from invoice 2 and paste the rest in a new sheet. In this case, it should copy the whole invoice 2 in a new sheet. It is allowed to have multiple invoices in 1 sheet, if 1) the invoices are complete and 2) the amount of rows is <999.

    I hope i am clear.
    I also added a sample file, how the layout is and with 2304 rows.

    Thanks for all your help!!!
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    06-14-2013
    Location
    jk
    MS-Off Ver
    Excel 2007
    Posts
    326

    Re: Split invoice file in max 1000 line items

    I came up myself with this solution, but it just endlessly keeps cutting and pasting in to new sheets into oblivion.

    Please Login or Register  to view this content.
    What do you guys think what's wrong with this code?

  3. #3
    Forum Contributor
    Join Date
    06-14-2013
    Location
    jk
    MS-Off Ver
    Excel 2007
    Posts
    326

    Re: Split invoice file in max 1000 line items

    Anybody?

  4. #4
    Valued Forum Contributor
    Join Date
    11-15-2008
    Location
    ph
    MS-Off Ver
    2007/2010/2016
    Posts
    479

    Re: Split invoice file in max 1000 line items

    Hi -

    Please try this one and let me know.
    Data in sheets(1)
    Note: Data will be remove so please run in the test file first.
    Please Login or Register  to view this content.
    event

  5. #5
    Forum Contributor
    Join Date
    06-14-2013
    Location
    jk
    MS-Off Ver
    Excel 2007
    Posts
    326

    Re: Split invoice file in max 1000 line items

    Hi Event,

    Thanks!
    It works!
    The only problem that i'm having with my testfile, is that it runs pretty slow.
    It took about 2 minutes for it to complete. Do you know what could be the reason?

  6. #6
    Valued Forum Contributor
    Join Date
    11-15-2008
    Location
    ph
    MS-Off Ver
    2007/2010/2016
    Posts
    479

    Re: Split invoice file in max 1000 line items

    Hi -

    The deletion of entire row takes time.
    try this one
    Please Login or Register  to view this content.
    to delete just the affected ranges


    event

  7. #7
    Forum Contributor
    Join Date
    06-14-2013
    Location
    jk
    MS-Off Ver
    Excel 2007
    Posts
    326

    Re: Split invoice file in max 1000 line items

    Ok. I will try your last one too.

    Could you tell me why mine isn't working? It seems simple but it gives me the Compile error: else without if.
    Even if it's fixed, i don't know if it would work.

    Please Login or Register  to view this content.

  8. #8
    Valued Forum Contributor
    Join Date
    11-15-2008
    Location
    ph
    MS-Off Ver
    2007/2010/2016
    Posts
    479

    Re: Split invoice file in max 1000 line items

    Hi -

    This one is wrong, there is no more IF in the succeeding elseif
    Please Login or Register  to view this content.
    event

  9. #9
    Forum Contributor
    Join Date
    06-14-2013
    Location
    jk
    MS-Off Ver
    Excel 2007
    Posts
    326

    Re: Split invoice file in max 1000 line items

    Thanks! I will check it out.
    Your code works smooth now! Thanks!!

  10. #10
    Forum Contributor
    Join Date
    06-14-2013
    Location
    jk
    MS-Off Ver
    Excel 2007
    Posts
    326

    Re: Split invoice file in max 1000 line items

    Hi Event,

    I tried your code with a real invoice document, which ofcourse i can't include, and the first part is 998 rows as it should be, but AP002 has only 443 rows, while AP003 has 70 rows. So it shouldn't have made the split and only keep AP002 with the total of 513 rows.
    Do you know what causes this?

  11. #11
    Valued Forum Contributor
    Join Date
    11-15-2008
    Location
    ph
    MS-Off Ver
    2007/2010/2016
    Posts
    479

    Re: Split invoice file in max 1000 line items

    Hi -

    I am not sure about it, what you can do is to upload the file (not the real data). All you need to do is to change the data (keep the formatting).

    event

  12. #12
    Forum Contributor
    Join Date
    06-14-2013
    Location
    jk
    MS-Off Ver
    Excel 2007
    Posts
    326

    Re: Split invoice file in max 1000 line items

    Ok, i will Event. Thanks.
    First enjoy my weekend

  13. #13
    Forum Contributor
    Join Date
    06-14-2013
    Location
    jk
    MS-Off Ver
    Excel 2007
    Posts
    326

    Re: Split invoice file in max 1000 line items

    Goodmorning Event,

    Please find the invoice attached. I replaced all the information with "test". For the invoiceno i used 1, 2, 3 etc.

    Thanks for all your help!!
    Attached Files Attached Files

  14. #14
    Valued Forum Contributor
    Join Date
    11-15-2008
    Location
    ph
    MS-Off Ver
    2007/2010/2016
    Posts
    479

    Re: Split invoice file in max 1000 line items

    Hi -

    Try
    Please Login or Register  to view this content.
    event

  15. #15
    Forum Contributor
    Join Date
    06-14-2013
    Location
    jk
    MS-Off Ver
    Excel 2007
    Posts
    326

    Re: Split invoice file in max 1000 line items

    Hi Event,

    Looks pretty awesome to me! Thank you so much, i wll try this with multiple files to see if everything is going alright.
    Many thanks again.

    Regards,
    Crispy85

  16. #16
    Forum Contributor
    Join Date
    06-14-2013
    Location
    jk
    MS-Off Ver
    Excel 2007
    Posts
    326

    Re: Split invoice file in max 1000 line items

    Hi Event,

    I don't know whats wrong, but i tested it with another invoice file, that has 2377 line items, and it doesn't make the split...
    Would you please be so kind to check?

    Thank you
    Attached Files Attached Files

  17. #17
    Valued Forum Contributor
    Join Date
    11-15-2008
    Location
    ph
    MS-Off Ver
    2007/2010/2016
    Posts
    479

    Re: Split invoice file in max 1000 line items

    Hi -

    Opppsss, try this one.
    Please Login or Register  to view this content.
    event

  18. #18
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,527

    Re: Split invoice file in max 1000 line items

    Re: First enjoy my weekend

    Where did you go? Havermarkt?

  19. #19
    Forum Contributor
    Join Date
    06-14-2013
    Location
    jk
    MS-Off Ver
    Excel 2007
    Posts
    326

    Re: Split invoice file in max 1000 line items

    Quote Originally Posted by jolivanes View Post
    Where did you go? Havermarkt?
    Haha, so you are familiar :D
    I'm at the Havermarkt pretty often indeed.

  20. #20
    Forum Contributor
    Join Date
    06-14-2013
    Location
    jk
    MS-Off Ver
    Excel 2007
    Posts
    326

    Re: Split invoice file in max 1000 line items

    Hi Event,

    The script is looking good! The other invoice now also comes out properly.
    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. Invoice Sales Tracker is messing up the invoice items
    By Kristina86 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-05-2015, 06:47 AM
  2. Saving Invoice where next time I open file the Invoice Number increases by 1
    By domgee in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-22-2013, 03:03 PM
  3. [SOLVED] Split Array, Listing Marked Items in Split Arrays
    By lesoies in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-27-2013, 02:07 AM
  4. How to Split Ver Large Exel File Into Smaller Files of 1000 Rows in Size
    By rusmith in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-26-2013, 02:11 PM
  5. Invoice and Its Saving File - Invoice draft
    By kuzna26 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-13-2013, 12:13 AM
  6. [SOLVED] Split large sheet in multiple 1000 row sheets
    By thotosch in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-14-2013, 06:29 AM
  7. Line Item split from total qty per invoice
    By BrianKusch in forum Excel General
    Replies: 7
    Last Post: 02-29-2012, 12:19 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