Hello Druids of excel
I'm fairly experienced with excel but green as grass with VBA.
I work with multiple workbooks that when completed need to be saved with individual titles and also as pdfs in various folders on our companies network drives.
I have already scrounged a very good piece of code from one of the forums on here already to save the active excel worksheet as a pdf and and name it as the contents of a target cell but would you gods of the spreadsheet be able to help me adapt the code to;
Once the worksheet has been checked for errors I would like to be able to do all of this at the press of a button if possible.
The code I have at the moment just to create a named pdf document and auto-open to inspect is
Private Sub CommandButton1_Click()
ActiveSheet.ExportAsFixedFormat _
Type:=xlTypePDF, _
Filename:=Range("X7"), _
Quality:=xlQualityStandard, _
IncludeDocProperties:=False, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=True
End Sub
Thank you for any help you can provide oh lords of the green X
I'm fairly experienced with excel but green as grass with VBA.
I work with multiple workbooks that when completed need to be saved with individual titles and also as pdfs in various folders on our companies network drives.
I have already scrounged a very good piece of code from one of the forums on here already to save the active excel worksheet as a pdf and and name it as the contents of a target cell but would you gods of the spreadsheet be able to help me adapt the code to;
- save the worksheet as a pdf. with the name as range("X7")
- save the pdf to a network folder with the address as range("X8")
- save the workbook as a xls. with the name as range("X7")
- save both the pdf and workbook to a network folder with the address as range("X8")
Once the worksheet has been checked for errors I would like to be able to do all of this at the press of a button if possible.
The code I have at the moment just to create a named pdf document and auto-open to inspect is
Private Sub CommandButton1_Click()
ActiveSheet.ExportAsFixedFormat _
Type:=xlTypePDF, _
Filename:=Range("X7"), _
Quality:=xlQualityStandard, _
IncludeDocProperties:=False, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=True
End Sub
Thank you for any help you can provide oh lords of the green X