Hello
I have several workbooks that are used to track sales scores and payouts. Each book relates to a "group" and each group a region. The Workbooks all vary in the number of reps being totaled and calculated.
I have a "Control" worksheet that has various components of the saving process including the list of sheet names that need to be saved (they all begin in cell A13)
Is it possible to write a looping code that will export the individual worksheets by first selecting the worksheet from the cells column A and then running a code similar to the one below. "SelectedSheet" would be the variable I am not sure on (the sheet name from Column A). I had this working as a test using ActiveSheet.Name, but i want to be able to be more flexible an have this work across all workbooks.
The confirmation message can be removed.
Thanks
I have several workbooks that are used to track sales scores and payouts. Each book relates to a "group" and each group a region. The Workbooks all vary in the number of reps being totaled and calculated.
I have a "Control" worksheet that has various components of the saving process including the list of sheet names that need to be saved (they all begin in cell A13)
Is it possible to write a looping code that will export the individual worksheets by first selecting the worksheet from the cells column A and then running a code similar to the one below. "SelectedSheet" would be the variable I am not sure on (the sheet name from Column A). I had this working as a test using ActiveSheet.Name, but i want to be able to be more flexible an have this work across all workbooks.
The confirmation message can be removed.
Code:
Sub Other_ActiveSheetPDF()
pdfName = SelectedSheet & "-" & Range("Rpt_Per")
pdfLoc = Range("Save_Loc")
WBname = Replace(ActiveWorkbook.Name, ".xlsm", "")
fileSaveName = pdfLoc & SelectedSheet & " - " & WBname & " - " & Range("Rpt_Per")
ActiveSheet.ExportAsFixedFormat _
Type:=xlTypePDF, _
FileName:=fileSaveName, _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=False
MsgBox "File Saved " & " " & fileSaveName
End Sub
Thanks