Hi, I want to print the active sheet to pdf. Active sheet contains value in cell A9, and other cells will use a vlookup based on A9 . I have this macro, it will print the active sheet to pdf and is working fine.
Sub printpdf()
'
' printpdf Macro
'
ChDir ActiveWorkbook.Path & ""
fileSaveName = Worksheets("Master").Range("A9").Value & " pdf file"
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
fileSaveName _
, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, OpenAfterPublish:=False
End Sub
Now I want to print many pdf files based on different values in A9. I want cell A9 to loop through a list (example below) and for each value print the active sheet.
List:
55
66
77
88
Macro logic:
A9 = 55
print
A9 = 66
print
A9 = 77
print
A9 = 88
print
Can anyone advise how to do this? Many thanks.
Sub printpdf()
'
' printpdf Macro
'
ChDir ActiveWorkbook.Path & ""
fileSaveName = Worksheets("Master").Range("A9").Value & " pdf file"
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
fileSaveName _
, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, OpenAfterPublish:=False
End Sub
Now I want to print many pdf files based on different values in A9. I want cell A9 to loop through a list (example below) and for each value print the active sheet.
List:
55
66
77
88
Macro logic:
A9 = 55
A9 = 66
A9 = 77
A9 = 88
Can anyone advise how to do this? Many thanks.