NoxGalleon106
New Member
- Joined
- Oct 15, 2016
- Messages
- 29
Hi,
I am working on a macro where it should automatically save PDF when the value for 2 cells in different sheets is not blank.
I have the below code but it does not run automatically, I have to press the "play" button in the module for it to run.
Please help check if there is something wrong with the code. Thank you.
Sub pdf()
Application.EnableEvents= False
If worksheets("fi").range("c58").value <> "" and worksheets("m").range("c58").value <> "" then
ActiveWorkbook.ExportAsFixedFormat_
Type:=xlTypePDF,_
Filename= "K:\Treasury\Daily\ " &_
"checklist" & ".pdf",_
quality:=xlQualityStandard,_
IncludeDocProperties:=False,_
IgnorePrintAreas:=True,_
OpenAfterPublish:= True
Application.EnableEvents=True
End sub
I am working on a macro where it should automatically save PDF when the value for 2 cells in different sheets is not blank.
I have the below code but it does not run automatically, I have to press the "play" button in the module for it to run.
Please help check if there is something wrong with the code. Thank you.
Sub pdf()
Application.EnableEvents= False
If worksheets("fi").range("c58").value <> "" and worksheets("m").range("c58").value <> "" then
ActiveWorkbook.ExportAsFixedFormat_
Type:=xlTypePDF,_
Filename= "K:\Treasury\Daily\ " &_
"checklist" & ".pdf",_
quality:=xlQualityStandard,_
IncludeDocProperties:=False,_
IgnorePrintAreas:=True,_
OpenAfterPublish:= True
Application.EnableEvents=True
End sub