Oprichnick
Board Regular
- Joined
- May 30, 2013
- Messages
- 69
Hello,
I've been working in a piece of code that changes, in another workbook, the name of each tab according to cell values and saves each worksheet as pdf file.
It does change correctly the tabs name and saves them as PDF, also correctly (named according to each tab name).
However the info in the pdf is from the workbook in which I have the code.
Thanks,
Oprichnick
I've been working in a piece of code that changes, in another workbook, the name of each tab according to cell values and saves each worksheet as pdf file.
It does change correctly the tabs name and saves them as PDF, also correctly (named according to each tab name).
However the info in the pdf is from the workbook in which I have the code.
Code:
Dim wks As Worksheet Dim wks As Worksheet
Dim strPath As String
Dim folderpath As String
With Workbooks("DLQ.xls")
For Each wks In .Sheets
With wks
If .Range("E16").Value <> "" Then .Name = Left(.Range("E16").Value, 3)
End With
Next wks
End With
With Workbooks("X.xls") For Each wks In .Sheets
With wks
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"C:\Users\pedro.david\Desktop\Driscoll's\9. DLQ Report\" & wks.Name & ".pdf" _
, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, OpenAfterPublish:=False
End With
Next wks
End With
End Sub
Thanks,
Oprichnick