+ Reply to Thread
Results 1 to 5 of 5

Print to PDF, new file at each page break

  1. #1
    Registered User
    Join Date
    04-06-2012
    Location
    Belfast, Northern Ireland
    MS-Off Ver
    Excel 2010
    Posts
    4

    Print to PDF, new file at each page break

    Hi All,

    My workbook is essentially a list of suppliers, I have various information on the service they have provided dates, invoice number and amount owing. By first selecting all rows and organising by the Suppliers name I get a neat list which I can apply the subtotal function to. This accurately splits out my suppliers showing a subtotal under each for the amount I owe them and putting in a page break between each supplier.

    In the past I paid them all by cheque so I simply printed this all out and gave them a copy as their remittance. I now pay them by bacs and they receive their remittance by email. Most want/require their remittance in the form of a pdf. The problem is that when I print to PDF it saves the entire workbook as one document.

    I need a macro to save each supplier to a different pdf document with the supplier name. I have had a go at this but am relatively useless with VBA.

    Do
    Selection.Copy
    Range("AL2").Select
    ActiveSheet.Paste
    ActiveSheet.Range("$V$3:$V$63356").AutoFilter Field:=1, Criteria1:=Range("AL2")
    Dim FP As String, FN As String
    FP = "W:\Simon\"
    FN = Range("AL2").Value
    ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=FP & FN & Format(Date, " dd-mm-yy"), Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False
    ActiveSheet.ShowAllData
    Columns("AK:AK").Select
    Selection.Find(What:=Range("AL2").Value, After:=ActiveCell, LookIn:= _
    xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _
    xlNext, MatchCase:=False, SearchFormat:=False).Activate
    ActiveCell.Select
    Selection.Offset(1, 0).Select
    Loop Until IsEmpty(Range("AL2"))
    Range("B3").Select
    End Sub

    Any help at all would be very much appreciated and save me a lot of time each month. Thanks in advance

  2. #2
    Valued Forum Contributor
    Join Date
    06-16-2006
    Location
    Sydney, Australia
    MS-Off Ver
    2013 64bit
    Posts
    1,394

    Re: Print to PDF, new file at each page break

    it is virtually impossible to help you without a sample book. The code above only has relevance if you can see the spreadsheet itself

  3. #3
    Registered User
    Join Date
    04-06-2012
    Location
    Belfast, Northern Ireland
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Print to PDF, new file at each page break

    Appologies, I will post up a sample of the book in question. School boy error

  4. #4
    Registered User
    Join Date
    04-06-2012
    Location
    Belfast, Northern Ireland
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Print to PDF, new file at each page break

    Please see image below as an example of what I am working with. Again thanks so much for your help.


    Excel image.jpg

    Please help!
    Last edited by murbal; 04-12-2012 at 12:30 PM.

  5. #5
    Registered User
    Join Date
    04-06-2012
    Location
    Belfast, Northern Ireland
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Print to PDF, new file at each page break

    Can anyone assist with this? I still cant get it to save all remittance slips as seperate pdfs

+ 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