rockchalk33
Board Regular
- Joined
- Jan 12, 2016
- Messages
- 111
Hey all,
So I'm at the tail end of an enormous project and at the end of a subroutine I have a specific sheet being saved as a PDF. This PDF is representing a group of information based on a specific date entered by the user in the mm/dd/yyyy format. This value is entered at the beginning of the sub routine and is shown here:
My goal is to have the PDF saved as ......../MM_DD_YYYY because saving it as MM/DD/YYYY obviously creates an error as seen in the code below.
How can I rewrite the above code to satisfy saving the data as well as representing the arbitrary date entered?
Thanks
So I'm at the tail end of an enormous project and at the end of a subroutine I have a specific sheet being saved as a PDF. This PDF is representing a group of information based on a specific date entered by the user in the mm/dd/yyyy format. This value is entered at the beginning of the sub routine and is shown here:
Code:
Dim userDate As String
userDate = InputBox("Please type a date to search in MM/DD/YYYY format")
My goal is to have the PDF saved as ......../MM_DD_YYYY because saving it as MM/DD/YYYY obviously creates an error as seen in the code below.
Code:
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"C:\Users\Rocky\Desktop\Devin\Project\" & userDate & ".pdf", Quality:= _
xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, _
OpenAfterPublish:=True
How can I rewrite the above code to satisfy saving the data as well as representing the arbitrary date entered?
Thanks