aprajitaj's blog
E-mail the contents of your Excel file using VBA
Submitted by aprajitaj on 3 July, 2013 - 12:31The below code mails a range of 20 cells, A1 through B10, from the currently active workbook to the e-mail address specified in the code:
Sub EmailRange()
' Select the range of cells on the active worksheet.
ActiveSheet.Range("A1:B10").Select
' Show the envelope on the ActiveWorkbook.
ActiveWorkbook.EnvelopeVisible = True
' Set the optional introduction field thats adds
' some header text to the email body. It also sets
' the To and Subject lines. Finally the message
' is sent.
With ActiveSheet.MailEnvelope
Recent comments
5 years 44 weeks ago
6 years 30 weeks ago
6 years 42 weeks ago
6 years 45 weeks ago
6 years 46 weeks ago
6 years 51 weeks ago
7 years 7 weeks ago
7 years 8 weeks ago
7 years 8 weeks ago
7 years 8 weeks ago