buitrunghieu
New Member
- Joined
- Jul 14, 2022
- Messages
- 1
- Office Version
- 2021
- Platform
- Windows
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!
I do not know how to Merge all "aShtLst" when printed to PDF to ONLY ONE PDF file? Please!
VBA 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
[COLOR=rgb(44, 130, 201)] ThisWorkbook.Sheets(aShtLst).PrintOut ActivePrinter:=pr, Copies:=TextBox3.Value
Worksheets(OrigSheet).Select[/COLOR]
Next
Unload Me
Exit Sub
ex:
MsgBox "ERORR"
End Sub
I do not know how to Merge all "aShtLst" when printed to PDF to ONLY ONE PDF file? Please!
Last edited by a moderator: