Hi,
I have two tabs, one called Service and the other called Sub Service. The Service tab is in Portrait mode where as the Sub Service tab is in landscape mode.
What I want to do is is run some code that PDFs both files as they are into one document however whenever I do this it seems to only want to do it in one format, The code im using is below.
I can put them on the same tab if thats easier too but I just need from Rows 1-211 in portrait and Rows 211-225 in landscape, Any assistance greatly appreciated
thank you
I have two tabs, one called Service and the other called Sub Service. The Service tab is in Portrait mode where as the Sub Service tab is in landscape mode.
What I want to do is is run some code that PDFs both files as they are into one document however whenever I do this it seems to only want to do it in one format, The code im using is below.
I can put them on the same tab if thats easier too but I just need from Rows 1-211 in portrait and Rows 211-225 in landscape, Any assistance greatly appreciated
VBA Code:
Sub BothpdfTest()
Dim wb As Workbook
Dim saveFolderPath As String
Dim saveFileName As String
' Set a reference to the workbook
Set wb = ThisWorkbook
' Prompt the user to choose the folder location using an Open dialog box
With Application.FileDialog(msoFileDialogFolderPicker)
.Title = "Select Folder to Save PDF"
.Show
If .SelectedItems.Count <> 0 Then
saveFolderPath = .SelectedItems(1) & "\"
Else
Exit Sub
End If
End With
' Set the desired file name for the PDF file
saveFileName = "Services 2024 " & Sheets("Service").Range("C3").Value & ".pdf"
' Select the specified tabs
Sheets(Array("Service", "Sub Service ")).Select
' Export the selected tabs as a PDF file
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, _
Filename:=saveFolderPath & saveFileName, _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False
MsgBox "PDF file created successfully!", vbInformation
End Sub
thank you