willow1985
Well-known Member
- Joined
- Jul 24, 2019
- Messages
- 893
- Office Version
- 365
- Platform
- Windows
I know I am writing this wrong (am getting an error) but am unsure how to modify it.
I am looking to export a sheet as pdf saving it as the filename specified in AB2 and directory specified in AB1.
Any help would be appreciated. Thank you!
I am looking to export a sheet as pdf saving it as the filename specified in AB2 and directory specified in AB1.
Any help would be appreciated. Thank you!
VBA Code:
Dim Path As String
Dim filename As String
Path = Workbooks("Weekly Reprocesses WPG").Sheets("Weekly Reprocess").Range("AB1")
filename = Workbooks("Weekly Reprocesses WPG").Sheets("Weekly Reprocess").Range("AB2")
ActiveSheet.SaveAsFixedFormat Type:=xlTypePDF, filename:=Path & filename & ".pdf", Quality:=xlQualityStandard, _
IncludeDocProperties:=False, IgnorePrintAreas:=False, OpenAfterPublish:=True