Arie Bos
Board Regular
- Joined
- Mar 25, 2016
- Messages
- 224
- Office Version
- 365
- Platform
- Windows
I have 70 sheets in a workbook (Named LP01-LP70). This amount may increase to 150.
Every month, I have to save these sheets as pdf's in a folder name that matches the current month: 17_08.
Now, I have the following line-by-line instruction, in which I manually replace the month number every time I do this.
Each line produces a pdf file with the name: "BBOT1 [17_08] LP33.pdf"
Sheets("LP01").ExportAsFixedFormat 0, "C:\Users\.....\Monthly Reports\17_08" & "BBOT1" & " [" & Sheets("START").Range("SelectedMonth") & "] " & Sheets("LP01").Range("Z11") & ".pdf"
Sheets("LP02").ExportAsFixedFormat 0, "C:\Users\.....\Monthly Reports\17_08" & "BBOT1" & " [" & Sheets("START").Range("SelectedMonth") & "] " & Sheets("LP02").Range("Z11")& ".pdf"
Sheets("LP03").ExportAsFixedFormat 0, "C:\Users\Arie\Dropbox\BCM\....
etc., 70 lines doing this same thing.
How can I make this smarter?
Every month, I have to save these sheets as pdf's in a folder name that matches the current month: 17_08.
Now, I have the following line-by-line instruction, in which I manually replace the month number every time I do this.
Each line produces a pdf file with the name: "BBOT1 [17_08] LP33.pdf"
Sheets("LP01").ExportAsFixedFormat 0, "C:\Users\.....\Monthly Reports\17_08" & "BBOT1" & " [" & Sheets("START").Range("SelectedMonth") & "] " & Sheets("LP01").Range("Z11") & ".pdf"
Sheets("LP02").ExportAsFixedFormat 0, "C:\Users\.....\Monthly Reports\17_08" & "BBOT1" & " [" & Sheets("START").Range("SelectedMonth") & "] " & Sheets("LP02").Range("Z11")& ".pdf"
Sheets("LP03").ExportAsFixedFormat 0, "C:\Users\Arie\Dropbox\BCM\....
etc., 70 lines doing this same thing.
How can I make this smarter?