Attach the following code to a button on the sheet you want to email.
The code creates a workbook containg a copy of the sheet you wish to send and uses the Workbook SendMail method email.
Sub eMailSheet()
ActiveSheet.Copy
ActiveSheet.DrawingObjects.Delete
With ActiveWorkbook
.SendMail Recipients:="emailAddress"
.Saved = True
.Close
End With
Ens Sub
The second line of code deletes any objects on the sheet so that the button to carry out the email is removed. If you have objects that you uwish to reatin on the sheet you will need to change that line to delete just the button that sends the form.
The workbook is closed without saving once the email is sent.
This has been a fantastic help to me, but I just have one question - acron, you mention that all that is needed to delete the button rather than all DrawingObjects is a simple change to the second line. I feel like a dunce, but I can't work out what change is needed to be made to that line. Could you please let me know what it is?
ActiveSheet.DrawingObjects("DrawingObjectName".delete
will delete a specified button - be careful tho - won't be the same syntax for "controls toolbox" buttons
Rgds, Geoff Si hoc legere scis, nimis eruditionis habes
Want the best answers to your questions ? - then read me baby one more time - faq222-2244
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.