I have a button on a sheet 1 in a workbook in which I want to make an order invoice a one step process when someone puts an order form. One sheet is the order form, one sheet is a form that needs saved without the first name cell to keep confidentiality and I want this saved in a PDF in order to send to the company in order for them to bill us, the third sheet is an authorization that copies what a person wants to order and wants this saved in order for it to be e-mailed to the person to authorize the order, but sometime a person would not need an authorization form.
I can get it to do each of the 3 things that I want to happen, but not all to happen at once. Is this possible, or will I need to have more buttons?
This code will print authorization form and print order form.
[Code]
Private Sub CommandButton2_Click()
Dim BDForm As Workbook
If (MsgBox("Do you need a Authorization form?", vbYesNo, ("Print Authorization form"))) = vbYes Then
Sheets("Authorization Form").Select
ActiveSheet.PrintOut
Else
End If
Sheets("BD_Order_Form").Select
ActiveSheet.PrintOut
End Sub
[\code]
This code will print order form and save in copy of the confidential copy in PDF form to be e-mailed later.
[code]
Private Sub CommandButton3_Click()
Dim BDForm As Workbook
Sheets("Copy_BD_Order_Form").Select
ActiveSheet.Copy
Set BDForm = ActiveWorkbook
With BDForm
ActiveWorkbook.ExportAsFixedFormat Type:=xltypepdr, Filename:= _
"C:\KIM_NICKLIN\BD" & Range("I5").Value & ".PDF", quality:= _
xlQualityStandard, includedocproperties:=True, ignoreprintareas:=False, _
openafterpublish:=False
.Close
End With
Sheets("BD_Order_Form").Select
ActiveSheet.PrintOut
End Sub
[\code]
This code will print order form and save a copy of the order form in an excel form to be edited later if needed.
[code]
Private Sub CommandButton3_Click()
Dim printsave As Workbook
Sheets("Copy_BD_Order_Form").Select
ActiveSheet.Copy
Set wbNew = ActiveWorkbook
With wbNew
ActiveWorkbook.SaveAs Filename:= _
"C:\KIM_NICKLIN\BD" & Range("I1").Value & ".xlsm" _
, FileFormat:=xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
.Close
End With
Sheets("BD_Order_Form").Select
ActiveSheet.PrintOut
End Sub
[\code]
I would like a button to do all three things, but I am new at writing code and am learning how to do code with multiple functions.
Would like some help in how to do this.
Thanks,
GJR
Bookmarks