How to Add an Excel VBA Confirmation Message After Sending Email
Question details
The user wants to display a confirmation pop-up message or visual indicator immediately after an Excel VBA macro successfully sends an email.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Running a VBA macro to send an email from an Excel order form and needing immediate user feedback upon successful completion.
- Observed behavior
- Currently, users press a command button to send the email but receive no immediate on-screen feedback, requiring them to wait for an automatic reply to know if the process worked.
Ensure your VBA macro for sending the email is fully set up, tested, and functioning correctly without errors before adding the final confirmation notification.
Add a MsgBox Pop-up Confirmation
The most direct way to notify users is by triggering a pop-up message box immediately after the email dispatch command in your VBA script.
A MsgBox halts the code execution and forces the user to acknowledge the prompt before continuing, making it perfect for definitive success confirmations.
Press Alt + F11 on your keyboard to open the Visual Basic for Applications (VBA) Editor, and locate the module containing your email-sending macro.
Scroll down to the end of your VBA script, directly after the line of code that actually sends the email (usually .Send).
Type the following line of code: MsgBox "SENT", vbInformation, "Confirmation". You can customize the word "SENT" to "Email sent successfully!" for a more descriptive notification.
Save your workbook as a Macro-Enabled Workbook (.xlsm). Click the command button on your worksheet to run the macro and verify that the pop-up appears after the email sends.

Write Confirmation Status to a Specific Cell
If you prefer a more subtle notification that doesn't interrupt the user with a pop-up, you can have the macro write a status message directly into a designated worksheet cell.
Use WPS Spreadsheet to Run and Edit VBA Macros
WPS Office offers robust, seamless support for VBA macros, allowing you to easily run, edit, and create automation scripts like email dispatching and confirmation pop-ups.
- 1. Open your macro file in WPS Office: Launch WPS Spreadsheet and open your existing Macro-Enabled Workbook (.xlsm).
- 2. Access the Developer tab: Navigate to the 'Developer' tab on the top ribbon menu. If it's not visible, you can enable it from the application settings.
- 3. Open the VBA Editor: Click on 'Visual Basic' to launch the VBA environment, where you can paste or modify your MsgBox confirmation code seamlessly.

Frequently Asked Questions
Can I add a Yes/No prompt to confirm before the email is actually sent?
Yes. You can use the MsgBox function with the vbYesNo argument at the beginning of your macro to ask the user for confirmation before executing the code. For example: If MsgBox("Are you sure you want to send this email?", vbYesNo) = vbNo Then Exit Sub.
Why doesn't my VBA confirmation message appear after clicking the button?
This usually happens if the macro encounters an error and stops before reaching the MsgBox line, or if the procedure branches off using GoTo statements or Exit Sub commands. Ensure the MsgBox code is placed directly in the successful execution path.
Is it possible to include the recipient's email address in the confirmation message?
Yes. You can concatenate variables within the MsgBox function. For instance, if your recipient is stored in a variable called strEmail, you can write: MsgBox "Email successfully sent to " & strEmail, vbInformation, "Confirmation".




