Louisthefirst
New Member
- Joined
- Apr 18, 2018
- Messages
- 3
Hi
I was really hoping someone can help me. I currently have a workbook set up that is a purchase order form. This form gets completed and I press the 'Print and Save' Macro which is at the bottom of the form. What this macro does is save the document to a specific folder on the network drive as a PDF and print the document out at the same time. Here is the Macro:
Sub Macro1()
'
' Macro1 Macro
' save as pdf
'
'
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"\\mynetworkdrive.local\DD\DD\Support\HR\Completed Purchase Orders" & Range("G3").Value & ".pdf", _
Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, From:=1, To:=1, OpenAfterPublish:=False
ExecuteExcel4Macro "PRINT(2,1,1,1,,,,,,,,2,,,TRUE,,FALSE)"
End Sub
Now this is all great, but annoying, because I then have to go back to the folder that the PDF was saved to and then move that PDF File to another folder. This other folder is the MONTH in which the excel purchase order was created.
So, what I would LOVE is if I could just point the above macro to check the date cell in the purchase order sheet that I have created (for example, in the purchase order sheet is a cell that has today's date in (F5) written as '18 April 2018' I would like it to read the contents of that date cell (F5) pick up the month of the date and actually save it as a pdf to what ever months folder it is, in this case April. It is worth nothing that the months folders (running from April to March) are located in the same folder as the pdf is saved to so I guess they are sub folders of the original save folder location.
Is this possible to do? If so, can someone help show me the macro to do this so I can just overwrite the old macro with it? (as you can probably tell, I didn't create the last one so really appreciate any help with this)
Thank you in advance
I was really hoping someone can help me. I currently have a workbook set up that is a purchase order form. This form gets completed and I press the 'Print and Save' Macro which is at the bottom of the form. What this macro does is save the document to a specific folder on the network drive as a PDF and print the document out at the same time. Here is the Macro:
Sub Macro1()
'
' Macro1 Macro
' save as pdf
'
'
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"\\mynetworkdrive.local\DD\DD\Support\HR\Completed Purchase Orders" & Range("G3").Value & ".pdf", _
Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, From:=1, To:=1, OpenAfterPublish:=False
ExecuteExcel4Macro "PRINT(2,1,1,1,,,,,,,,2,,,TRUE,,FALSE)"
End Sub
Now this is all great, but annoying, because I then have to go back to the folder that the PDF was saved to and then move that PDF File to another folder. This other folder is the MONTH in which the excel purchase order was created.
So, what I would LOVE is if I could just point the above macro to check the date cell in the purchase order sheet that I have created (for example, in the purchase order sheet is a cell that has today's date in (F5) written as '18 April 2018' I would like it to read the contents of that date cell (F5) pick up the month of the date and actually save it as a pdf to what ever months folder it is, in this case April. It is worth nothing that the months folders (running from April to March) are located in the same folder as the pdf is saved to so I guess they are sub folders of the original save folder location.
Is this possible to do? If so, can someone help show me the macro to do this so I can just overwrite the old macro with it? (as you can probably tell, I didn't create the last one so really appreciate any help with this)
Thank you in advance