Hi, I creating a Sale Receipt Number using VBA. I created a Buttom for "SAVE & NEXT RECEIPT".
Everything were alright.
However, I actually planning to have 2 buttons "Save as PDF", this button I want to create the code whereby it will save as PDF and this PDF will save to "Draft PDF File", it also able to save the current sheet to another "Draft Sheet file" for final edit after Customer made the payment. I don't want to sheet to clear contents as I need to edit.
The 2nd button "Save as Final", this button is for those customer made the payment and I edit the mode of payment etc. It will save as PDF to the"Final File" for record.
Am I able to do so?
Please guide me along.
Below are the code that I use for my sale receipt.
Private Sub CommandButton1_Click()
'for receipt number
Sheet3.Range("C5").Value = Sheet3.Range("C5").Value + 1
'for PDF file save
Sheet3.Range("A1:H46").ExportAsFixedFormat xlTypePDF, Filename:= _
"C:\Users\JOYCELYN SEE\Desktop\YY\YY Live\Receipt\" & Sheet3.Range("C9").Value, Openafterpublish:=True
' for clear receipt
Sheet3.Range("C9:H13").ClearContents
Sheet3.Range("B16:B31").ClearContents
Sheet3.Range("F16:F31").ClearContents
End Sub
Everything were alright.
However, I actually planning to have 2 buttons "Save as PDF", this button I want to create the code whereby it will save as PDF and this PDF will save to "Draft PDF File", it also able to save the current sheet to another "Draft Sheet file" for final edit after Customer made the payment. I don't want to sheet to clear contents as I need to edit.
The 2nd button "Save as Final", this button is for those customer made the payment and I edit the mode of payment etc. It will save as PDF to the"Final File" for record.
Am I able to do so?
Please guide me along.
Below are the code that I use for my sale receipt.
Private Sub CommandButton1_Click()
'for receipt number
Sheet3.Range("C5").Value = Sheet3.Range("C5").Value + 1
'for PDF file save
Sheet3.Range("A1:H46").ExportAsFixedFormat xlTypePDF, Filename:= _
"C:\Users\JOYCELYN SEE\Desktop\YY\YY Live\Receipt\" & Sheet3.Range("C9").Value, Openafterpublish:=True
' for clear receipt
Sheet3.Range("C9:H13").ClearContents
Sheet3.Range("B16:B31").ClearContents
Sheet3.Range("F16:F31").ClearContents
End Sub