jondavis1987
Active Member
- Joined
- Dec 31, 2015
- Messages
- 443
- Office Version
- 2019
- Platform
- Windows
I am trying to export the sheet named A and the sheet named Sheet2. The below code is part of a big macro that i'm using. When i use the macro it exports the entire workbook as a pdf.
VBA Code:
fName = srcWB.Sheets("A").Range("A!F19").Value
Dim FolderPath As String
FolderPath = "C:\Users\jdavis\Dropbox\Quality Control\Asphalt\Asphalt Reports\"
Sheets(Array("A", "Sheet2")).Select
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=FolderPath & fName, _
openafterpublish:=True, ignoreprintareas:=False
End With
End If
End Sub