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 47 weeks ago
6 years 33 weeks ago
6 years 45 weeks ago
6 years 48 weeks ago
6 years 49 weeks ago
7 years 2 weeks ago
7 years 10 weeks ago
7 years 11 weeks ago
7 years 11 weeks ago
7 years 11 weeks ago