Hello,
I have the below code that saves my required sheets as pdf to current folder. However I would like it to create a new folder in the current directory which will have a set text name.
Any assistance would be most appreciated.
Thank you
I have the below code that saves my required sheets as pdf to current folder. However I would like it to create a new folder in the current directory which will have a set text name.
Any assistance would be most appreciated.
Thank you
Code:
Sub SaveWorksheetsAsPDFs() Dim sFile As String
Dim sPath As String
Dim wks As Worksheet
With ActiveWorkbook
sPath = .Path & "\"
For Each wks In .Worksheets
If LCase(wks.Range("N2").Value) = "print" Then
sFile = wks.Range("A6").Value & ".pdf"
wks.ExportAsFixedFormat Type:=xlTypePDF, _
Filename:=sPath & sFile, _
Quality:=xlQualityStandard, _
IncludeDocProperties:=False, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=False
End If
Next wks
End With
End Sub