This code only saves with the workbook name and not the text "Sample". What am I doing wrong? All answers appreciated Thanks, Ed
Sub SamplePDF()
Dim strFolder As String
Dim i As Long
'Find the position of the period in the file name
i = InStr(ActiveWorkbook.Name, ".")
Filename = Left(ActiveWorkbook.Name, i - 1) & " Sample "
Sheets(" Sample ").Select
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Quality _
:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, _
OpenAfterPublish:=True
End Sub
Sub SamplePDF()
Dim strFolder As String
Dim i As Long
'Find the position of the period in the file name
i = InStr(ActiveWorkbook.Name, ".")
Filename = Left(ActiveWorkbook.Name, i - 1) & " Sample "
Sheets(" Sample ").Select
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Quality _
:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, _
OpenAfterPublish:=True
End Sub