+ Reply to Thread
Results 1 to 10 of 10

Formula/program to split an excel sheet into multiple PDF files

  1. #1
    Registered User
    Join Date
    06-01-2023
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    6

    Formula/program to split an excel sheet into multiple PDF files

    Hi,

    I'm wondering if this is possible, but basically I have my all customers in one sheet and I'm wondering if there's a way for each customer and their items to be sent to a sperate PDF file (automatic invoices instead of having to copy and paste each customer into a separate excel file then to a PDF).

    File.xlsxUntitled.png The reason all my customers are on one sheet because I bulk ship abroad and it's easier that way to make a packing list. I've attached a file that can be worked on and an image explaining the problem further.

  2. #2
    Spammer
    Join Date
    10-23-2012
    Location
    Adelaide, Australia
    MS-Off Ver
    Excel 2003, Office 365
    Posts
    1,237

    Re: Formula/program to split an excel sheet into multiple PDF files

    OK, I'm happy to help you with this.

    A couple of questions;

    1. Where do you want the individual PDFs stored? The same pathname as where your workbook is?
    2. What Name do you want to give each PDF? I suggest the customer name highlighted in the blue cells...is that OK?
    3. There is some detail on your invoice in sheet 1 that I cannot see on Sheet4 for each customer. Address, Invoice No., Email, Telephone comes to mind. I also assume the date you want is todays date?

  3. #3
    Registered User
    Join Date
    06-01-2023
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    6

    Re: Formula/program to split an excel sheet into multiple PDF files

    Oh wow, I never expected anyone to reply. Thank you so much.

    1. Yes - basically the folder that the main excel file (Shipment 704) will be in.

    2. Yes




    3. Luckily our invoicing template isn't that complicated in terms of customer details (as we bulk ship and they pickup from our office)

    This is my current way:

    I copy and paste the customer's name and items from file "Shipment 704" into excel file "Customer invoice template", fill in the details myself and then convert to PDF. I do that for each customer individually.


    Basically I don't need an address or a special invoice number for each customer, those are the same across all customers. Once shipment 704 is done, then I move onto shipment 705 and create a new excel file and so on.



    I've attached a new main file, a customer template file and the final PDF.


    Would appreciate any help with this but if it's not doable, then I understand. I'm in my 60s and not very tech savvy.

    Alice Holmes.pdf

    Customer invoice template.xlsx

    Shipment 704.xlsx

  4. #4
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Cool Hi, try this !


    According to your attachment a VBA procedure for starters to paste only to the template workbook Sheet4 worksheet module.
    Once done save it as binary format .xlsb …

    Open a shipment workbook before to run this VBA demonstration :

    PHP Code: 
    Sub Demo1()
             
    Dim Wb As WorkbookoLi As ListObject
        
    For Each Wb In Workbooks
              
    If Wb.Name Like "Shipment *.xlsx" Then Exit For
        
    Next
        
    If Not Wb Is Nothing Then
            
    [F9] = Split(Wb.Name".")(0)
            [
    B11] = Wb.ActiveSheet.[A1]
            [
    F11] = Date
        
    For Each oLi In Wb.ActiveSheet.ListObjects
              
    If oLi.ListRows.Count Then
                 
    [B9,C13] = oLi.Range(03)
                 
    oLi.DataBodyRange.Copy ListObjects(1).HeaderRowRange(21)
                 
    ExportAsFixedFormat 0Wb.Path "\" & [B9], 0
                 ListObjects(1).DataBodyRange.ClearContents
              End If
        Next
            ThisWorkbook.Saved = True
            Set Wb = Nothing
        End If
    End Sub 
    ► Do you like it ? ► So thanks to click on bottom left star icon « Add Reputation » !

  5. #5
    Spammer
    Join Date
    10-23-2012
    Location
    Adelaide, Australia
    MS-Off Ver
    Excel 2003, Office 365
    Posts
    1,237

    Re: Formula/program to split an excel sheet into multiple PDF files

    There we go! You'll now be flooded with offers to help!

    Let me know if this beginners, demonstration for starters does what you want.

    If not, I'll help you out with a more advanced one. LOL.

  6. #6
    Registered User
    Join Date
    06-01-2023
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    6

    Re: Hi, try this !

    Thank you very much for this.

    It kinda worked and 3 PDF files were created. The only issue I had is each PDF file still showed all 3 customers instead of just the customer the file is named under.

    Is there a way around this, so when I run the macro each customer and their items will be a separate PDF file without showing the 2 other customers?

  7. #7
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow Re: Formula/program to split an excel sheet into multiple PDF files


    There is no way as it well works as expected on my side so the bad is on yours !
    So you must just well follow post #4 direction

  8. #8
    Spammer
    Join Date
    10-23-2012
    Location
    Adelaide, Australia
    MS-Off Ver
    Excel 2003, Office 365
    Posts
    1,237

    Re: Formula/program to split an excel sheet into multiple PDF files

    If you are still having trouble with your 'procedure for starters', you may want to try this (see attached);
    Please Login or Register  to view this content.
    Attached Files Attached Files

  9. #9
    Forum Contributor
    Join Date
    02-08-2021
    Location
    africa
    MS-Off Ver
    2016
    Posts
    410

    Re: Formula/program to split an excel sheet into multiple PDF files

    @EyadJawad
    just curiosity why you just split the files based on Shipment 704 file instead of use two both files?
    what I misunderstood or misread? !
    what's the useful for Customer invoice template file?
    I think this is not practical way despite of you got for perfect solution by Marc & Croweater

  10. #10
    Spammer
    Join Date
    10-23-2012
    Location
    Adelaide, Australia
    MS-Off Ver
    Excel 2003, Office 365
    Posts
    1,237

    Re: Formula/program to split an excel sheet into multiple PDF files

    How did you go with this? Did you get it working?

+ 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: 3
    Last Post: 11-05-2019, 03:02 AM
  2. Split Multiple Sheet in Excel to multiple excel files
    By aboorkuma in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-31-2018, 09:51 PM
  3. Split workbook into multiple files based on cell in each sheet
    By fiona.forde0 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-28-2016, 03:47 PM
  4. How to split multiple excel data /sheets into multiple PDF files
    By Faridwahidi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-08-2014, 12:25 PM
  5. [SOLVED] Split Large Excel file to multiple excel files and possible save the files
    By EnzioL in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-20-2012, 03:28 AM
  6. split a sheet into multiple files
    By sakshipatil in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 09-30-2011, 03:43 AM
  7. [SOLVED] Saving and Closing multiple files and Excel program
    By Roger in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-18-2005, 11:05 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