Excel Macro to save, email and display messagebox

CorpusSpongiosum

New Member
Joined
Mar 8, 2002
Messages
9
I have assigned this code to a control button on a worksheet. It saves the worksheet and emails it but no message box is displayed. Does anyone know why and how to make the message box appear once the worksheet has been emailed?

Thanks

Sub Save()
'
' Save Macro
' Macro recorded 18/01/2002 by Craig
'

'
ActiveWorkbook.Save
End Sub
Sub Email()
'
' Email Macro
' Macro recorded 18/01/2002 by Craig
'

'
mailname = "Dionysius@btinternet.com"

ActiveWorkbook.SendMail Recipients:=mailname, Subject:="GDOCS Rota Submission", ReturnReceipt:="True"

End Sub

Sub Message()

MsgBox "Congratulations your rota bid has been submitted sucessfully. Have a nice day!"

End Sub
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
If that is your whole code, I don't see how more than one module runs. You would have to call each module from somewhere. To directly answer your question you would have to add a line of like :

<pre>
Call Message
</pre>

To make the message show after the email has been sent.

HTH
 
Upvote 0

Forum statistics

Threads
1,214,636
Messages
6,120,664
Members
448,976
Latest member
sweeberry

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