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
Bookmarks