Hello All,
I'm trying to write code to allow a user of the excel spreadsheet to click a button then a pop-up box appears that needs to be checked, once it's checked the code that I have will save the document and then prepare it to be emailed. The problem that I'm having is I don't know how to write the code to have the rest of the code to start working after the check box is selected. Below is the code that I currently have - once the button is selected in Excel - a pop up appears and states they need to check the box and this is where I get stuck:
Sub Customer_PO_Acknowledgement()
UserForm1.Show
' Customer_Usage_Report Macro
' This macro will allow the document to be prepared and sent to Dell
Sheets("CUSTOMER").Copy
filenam = "C:\Customer Purchase Order Form" & Range("F4") & ("_") & Range("C5") & (" ") & Range("F5") & ("_") & Format(Now(), "mmddyy") & ".xlsm"
ActiveSheet.Shapes.SelectAll
Selection.Delete
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
ActiveWorkbook.Protect Structure:=True, Windows:=False
ActiveWorkbook.SaveAs Filename:=filenam, FileFormat:=xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
Application.Dialogs(xlDialogSendMail).Show
ActiveWorkbook.Close
Windows("Customer Purchase order Form.xlsm").Activate
End Sub
Thank you, for your assistance.
I'm trying to write code to allow a user of the excel spreadsheet to click a button then a pop-up box appears that needs to be checked, once it's checked the code that I have will save the document and then prepare it to be emailed. The problem that I'm having is I don't know how to write the code to have the rest of the code to start working after the check box is selected. Below is the code that I currently have - once the button is selected in Excel - a pop up appears and states they need to check the box and this is where I get stuck:
Sub Customer_PO_Acknowledgement()
UserForm1.Show
' Customer_Usage_Report Macro
' This macro will allow the document to be prepared and sent to Dell
Sheets("CUSTOMER").Copy
filenam = "C:\Customer Purchase Order Form" & Range("F4") & ("_") & Range("C5") & (" ") & Range("F5") & ("_") & Format(Now(), "mmddyy") & ".xlsm"
ActiveSheet.Shapes.SelectAll
Selection.Delete
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
ActiveWorkbook.Protect Structure:=True, Windows:=False
ActiveWorkbook.SaveAs Filename:=filenam, FileFormat:=xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
Application.Dialogs(xlDialogSendMail).Show
ActiveWorkbook.Close
Windows("Customer Purchase order Form.xlsm").Activate
End Sub
Thank you, for your assistance.