Receipt Number save as PDF for Draft

Jongnj87

New Member
Joined
Oct 16, 2020
Messages
32
Office Version
  1. 365
Platform
  1. Windows
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
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.

Forum statistics

Threads
1,215,016
Messages
6,122,700
Members
449,092
Latest member
snoom82

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top