Jyggalag
Active Member
- Joined
- Mar 8, 2021
- Messages
- 445
- Office Version
- 365
- 2019
- Platform
- Windows
Hi all,
I currently have a macro that converts my excel sheet into a PDF and saves it in a designated folder. However, I only want it to save the first sheet as a PDF, and ignore my other sheets, which it will not do at the moment.
My code looks as follows:
A63 is the cell in which I type in the name of the PDF file to be saved.
Can anybody help me fix my macro so it only saves the first sheet in the below picture (the one called "Sheet3")?
Thank you!
I currently have a macro that converts my excel sheet into a PDF and saves it in a designated folder. However, I only want it to save the first sheet as a PDF, and ignore my other sheets, which it will not do at the moment.
My code looks as follows:
VBA Code:
Option Explicit
Sub SaveFileWithMacro()
Dim Path As String
Dim fn As String
Path = "S:\PATH\Tracking\PDF files\"
fn = Range("A63")
ActiveWorkbook.ExportAsFixedFormat Type:=xlTypePDF, _
Filename:=Path & fn & ".pdf"
End Sub
A63 is the cell in which I type in the name of the PDF file to be saved.
Can anybody help me fix my macro so it only saves the first sheet in the below picture (the one called "Sheet3")?
Thank you!