Hi
I've written a code to print specific sheets based on the name, viz.
Sub MyPrint()
Windows("161082.xlsm").Activate
Sheets(Array("P026", "P062", "P125", "P461", "P645", "P721", "PMF15", "PMF57", "PMF62", "PMF65", "PMF66")).Select
ActiveSheet.ExportAsFixedFormat _
Type:=xlTypePDF, _
Filename:="C:\Users\riazd.PLAZA\Desktop\Payslips" & "SCS Lynette", _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=False
Sheets(Array("P021", "P028", "P056", "P356", "P557")).Select
ActiveSheet.ExportAsFixedFormat _
Type:=xlTypePDF, _
Filename:="C:\Users\riazd.PLAZA\Desktop\Payslips" & "Wrap", _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=False
End Sub
The macro runs perfectly, but i would like to enhance it by
Any help will be appreciated,
I've written a code to print specific sheets based on the name, viz.
Sub MyPrint()
Windows("161082.xlsm").Activate
Sheets(Array("P026", "P062", "P125", "P461", "P645", "P721", "PMF15", "PMF57", "PMF62", "PMF65", "PMF66")).Select
ActiveSheet.ExportAsFixedFormat _
Type:=xlTypePDF, _
Filename:="C:\Users\riazd.PLAZA\Desktop\Payslips" & "SCS Lynette", _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=False
Sheets(Array("P021", "P028", "P056", "P356", "P557")).Select
ActiveSheet.ExportAsFixedFormat _
Type:=xlTypePDF, _
Filename:="C:\Users\riazd.PLAZA\Desktop\Payslips" & "Wrap", _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=False
End Sub
The macro runs perfectly, but i would like to enhance it by
- Using lists on a control sheet to populate the sheet names based on a dynamic range e.g. A2:A13 is the first print parameters B3:B7 is the second print parameters ect.
- Use the header row to name the output file e.g. A1 is SCS LL B1 is Wrap
Any help will be appreciated,