• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

How to Combine each Multiple Sheets to ONLY ONE PDF file?

buitrunghieu

New Member
The first, I am very sorry because I am not good at English. I have a problem. Please help me how to Combine Sheet "YCNT" and "NTXD" to ONE Pdf file. Just like Mail Merge in Microsoft Word when I "Finish & Merge" -> Merge to New Document -> From ... To ... -> So I have Only One Document to see. Thank you!
 

Attachments

  • Print_Merge.xlsm
    179.4 KB · Views: 2
buitrunghieu
eg this way:
>>> use code - tags <<<
Code:
Private Sub CommandButton1_Click()
On Error GoTo ex
Dim pr As Variant
Dim aShtLst As Variant
Dim OrigSheet As Variant
Dim ichg As Integer, i1 As Integer, i2 As Integer

aShtLst = Array("YCNT", "NTXD")
OrigSheet = ActiveSheet.Name
i1 = TextBox1.Value
i2 = TextBox2.Value
pr = Application.Dialogs(xlDialogPrinterSetup).Show
If pr = False Then Exit Sub
For ichg = i1 To i2
Range(RefEdit1).Formula = ichg
Calculate
ThisWorkbook.Sheets(aShtLst).PrintOut ActivePrinter:=pr, Copies:=TextBox3.Value
Worksheets(OrigSheet).Select
Next
Unload Me
Exit Sub
ex:
MsgBox "ERORR"
End Sub
I don't know the VBA Code how to Combine All Sheet when printed. I think need something the code I Bold
 
Last edited by a moderator:
buitrunghieu
You opened Your thread to Ask an Excel Question
That's why You got an Excel sample solution.
Do You now would like to get a VBA Macros -solution?

Please, reread Forum Rules
 
I mean when I choose "Microsoft Print to PDF" so I must Set file name Each PDF File export. At the Picture I must set name 1,2,3. How I can I Merge 1-2-3 when I run Macro. I can not do that.
800428004380044
 
buitrunghieu
Seems You skipped that link ...
Code:
Sub ExportAsPDF()
    Sheets(Array("YCNT","NTXD")).Select
    ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=ThisWorkBook.Path & "/buitrunghieu", openafterpublish:=False, ignoreprintareas:=False
   MsgBox "All PDF's have been successfully exported."
End Sub
Ps Not tested above code
 
Thanks for your help. I click and read the link you gave me. I tried but it's not work. I don't know where the code put in My macro :(
80045
 
I have a Spin Button. The value in "IN" Column. In the future, the Value maybe from 1 to n. For example When I print PDF from 1 to 7. Not only just Print one Value, It means the total page PDF is 2/2. I WISH I can export the PDF file from 1 to 7, It means have 14/14 Pages from "YCNT" sheet and "NTXD" Sheet.
80051
 
The first, I am very sorry because I am not good at English. I have a problem. Please help me how to Combine Sheet "YCNT" and "NTXD" to ONE Pdf file. Just like Mail Merge in Microsoft Word when I "Finish & Merge" -> Merge to New Document -> From ... To ... -> So I have Only One Document to see. Thank you!
Convert Multiple Excel Files to PDF using Convert Multiple
  1. Quit Excel if it is already open.
  2. Choose File> Create PDF> Batch Create Multiple Files.
  3. In the Batch Create Multiple Files window, click the Files to add in word combiner or file combiner and choose whether you want to process individual files or Folders, Click OK.
 
The first, I am very sorry because I am not good at English. I have a problem. Please help me how to Combine Sheet "YCNT" and "NTXD" to ONE Pdf file. Just like Mail Merge in Microsoft Word combiner when I "Finish & Merge" -> Merge to New Document -> From ... To ... -> So I have Only One Document to see. Thank you!
Hello there!
Can you try this?. Are you satisfied about my solution.
 
Back
Top