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 36 weeks ago
6 years 22 weeks ago
6 years 34 weeks ago
6 years 37 weeks ago
6 years 38 weeks ago
6 years 43 weeks ago
6 years 52 weeks ago
7 years 2 days ago
7 years 3 days ago
7 years 3 days ago