I have an excel workbook in excel 2007 which has approx 110 separate worksheets.
I want to have a menu page where the user can say yes or no to the title of the worksheet they want and press a button to run a macro which will then select the worksheets which the user has said Y too and then print them to PDF as one single PDF and not loads of individual PDFs.
I currently have the following code which selects the worksheets and prints them. At present though when I select a PDF printer it prints but only to multiple PDFs and not one single PDF.
Sub Printselection()
Dim rng As Range
Dim wks As Worksheet
For Each rng In Sheets("RA Database").Range("Q6:Q119")
If Trim(rng.Value) <> "" Then
On Error Resume Next
Set wks = Nothing
Set wks = Sheets(rng.Value)
On Error GoTo 0
If wks Is Nothing Then
MsgBox "Sheet " & rng.Value & " does not exist"
Else
Application.Dialogs(xlDialogPrinterSetup).Show
wks.PrintOut
End If
End If
Next rng
End Sub
The hard copy I'm happy for it to work like this but we need for the PDF copy to collate.
I'm a VB newbie so any help really would be appreciated!!