Hi,
Below is the code I'm using to create pdf files for each worksheet in an excel file.
I'm looking to have the pdf files named after a cell value I2 in each tab however it is still working off the worksheet tab name.
Sub pdfmultiplesheets()
Dim saveInFolder As String
Dim ws As Worksheet
saveInFolder = ThisWorkbook.Path
For Each ws In ThisWorkbook.Worksheets
If ws.Name <> "Sheet3" Then
ws.ExportAsFixedFormat xlTypePDF, Filename:=saveInFolder & "\" & Range("I2") & ws.Name & ".pdf"
End If
Next ws
End Sub
Any suggestions?
Thanks,
Below is the code I'm using to create pdf files for each worksheet in an excel file.
I'm looking to have the pdf files named after a cell value I2 in each tab however it is still working off the worksheet tab name.
Sub pdfmultiplesheets()
Dim saveInFolder As String
Dim ws As Worksheet
saveInFolder = ThisWorkbook.Path
For Each ws In ThisWorkbook.Worksheets
If ws.Name <> "Sheet3" Then
ws.ExportAsFixedFormat xlTypePDF, Filename:=saveInFolder & "\" & Range("I2") & ws.Name & ".pdf"
End If
Next ws
End Sub
Any suggestions?
Thanks,