Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in
x
or
x
x
Register
x

or

How to send / email range of cells through outlook from Excel?

Have you ever suffered with a problem that after finishing a report in a worksheet, and you need to send to a range of cells in this worksheet which contain some important data to your specific recipient. Are there any quick ways for you to email this range from Excel without opening Outlook?

Send range of cells as attachment from Excel with VBA code

Send range of cells as body from Excel with VBA code


You may interested in this utility:

Remove Duplicate Mails

Click Kutools > Duplicate > Mails to quickly list all duplicate emails, and then delete them at on click.
doc duplicate mail 1
doc arrow
doc duplicate mail 2


arrow blue right bubbleSend range of cells as attachment from Excel with VBA code


The following VBA code can help you to send your selected range as attachment in Excel. Please do as this:

Kutools for Excel, with more than 120 handy functions, makes your jobs easier. 

1. Open your workbook and then hold down the ALT + F11 keys to open the Microsoft Visual Basic for Applications window.

2. Click Insert > Module, and paste the following code in the Module Window.

VBA code: send range of cells as attachment from Excel

Sub SendRange()
'Update 20131209
Dim xFile As String
Dim xFormat As Long
Dim Wb As Workbook
Dim Wb2 As Workbook
Dim Ws As Worksheet
Dim FilePath As String
Dim FileName As String
Dim OutlookApp As Object
Dim OutlookMail As Object
Dim WorkRng As Range
xTitleId = "KutoolsforExcel"
Set WorkRng = Application.Selection
Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8)
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Set Wb = Application.ActiveWorkbook
Wb.Worksheets.Add
Set Ws = Application.ActiveSheet
WorkRng.Copy Ws.Cells(1, 1)
Ws.Copy
Set Wb2 = Application.ActiveWorkbook
Select Case Wb.FileFormat
Case xlOpenXMLWorkbook:
    xFile = ".xlsx"
    xFormat = xlOpenXMLWorkbook
Case xlOpenXMLWorkbookMacroEnabled:
    If Wb2.HasVBProject Then
        xFile = ".xlsm"
        xFormat = xlOpenXMLWorkbookMacroEnabled
    Else
        xFile = ".xlsx"
        xFormat = xlOpenXMLWorkbook
    End If
Case Excel8:
    xFile = ".xls"
    xFormat = Excel8
Case xlExcel12:
    xFile = ".xlsb"
    xFormat = xlExcel12
End Select
FilePath = Environ$("temp") & "\"
FileName = Wb.Name & Format(Now, "dd-mmm-yy h-mm-ss")
Set OutlookApp = CreateObject("Outlook.Application")
Set OutlookMail = OutlookApp.CreateItem(0)
Wb2.SaveAs FilePath & FileName & xFile, FileFormat:=xFormat
With OutlookMail
    .To = "skyyang@extendoffice.com"
    .CC = ""
    .BCC = ""
    .Subject = "information of kte"
    .Body = "hello, please check and read this document. "
    .Attachments.Add Wb2.FullName
    .Send
End With
Wb2.Close
Kill FilePath & FileName & xFile
Set OutlookMail = Nothing
Set OutlookApp = Nothing
Ws.Delete
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub

Note: In the above code, you can change the following information to your own need.

  • .To = "skyyang@extendoffice.com"
  • .CC = ""
  • .BCC = ""
  • .Subject = "information of kte"
  • .Body = "hello, please check and read this document."

3. Then click F5 key to run this code, and a prompt box will pop out to remind you selecting a range that you want to send. See screenshot:

doc-send-range1

4. Then click OK, and a prompt box will appear, after the progress bar finishing, click Allow, and then the specific range of cells has been sent to your recipient as an attachment.

doc-send-range2


arrow blue right bubbleSend range of cells as body from Excel with VBA code

If you want to send a specific range as part of message body from Excel, you can also apply the following VBA code to solve it.

Kutools for Excel, with more than 120 handy functions, makes your jobs easier. 

1. Activate your worksheet and hold down the ALT + F11 keys to open the Microsoft Visual Basic for Applications window.

2. Click Insert > Module, and paste the following code in the Module Window.

VBA code: send range of cells as body from Excel

Sub EmailRange()
'Update 20131209
Dim WorkRng As Range
On Error Resume Next
xTitleId = "KutoolsforExcel"
Set WorkRng = Application.Selection
Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8)
Application.ScreenUpdating = False
WorkRng.Select
ActiveWorkbook.EnvelopeVisible = True
With ActiveSheet.MailEnvelope
    .Introduction = "Please read this email."
    .Item.To = "skyyang@extendoffice.com"
    .Item.Subject = "information of kte"
    .Item.Send
End With
Application.ScreenUpdating = True
End Sub

Note: In the above code, you can change the following information to your need.

  • .Introduction = "Please read this email."
  • .Item.To = "skyyang@extendoffice.com"
  • .Item.Subject = "information of kte"

3. Then click F5 key to run this code, and a prompt box will pop out to remind you to selecting a range that you want to send.

doc-send-range1

4. Then click OK, and a prompt box will appear, after the progress bar finishing, click Allow, and then the specific range of cells has been sent to your recipient as message body.

doc-send-range2

Notes:

1. These codes are only available when the Outlook as your mail program.

2. After sending the current worksheet, you can go to your Outlook to make sure whether the email has been sent successfully.


Related articles:

How to send worksheet only through Outlook from Excel?

How to send current workbook through Outlook from Excel?


Recommended Productivity Tools

Ribbon of Excel (with Kutools for Excel installed)

300+ Advanced Features Increase Your Productivity by 71%, and Help You To Stand Out From Crowd!

Would you like to complete your daily work quickly and perfectly? Kutools For Excel brings 300+ cool and powerful advanced features (Combine workbooks, sum by color, split cell contents, convert date, and so on...) for 1500+ work scenarios, helps you solve 82% Excel problems.

  •  Deal with all complicated tasks in seconds, help to enhance your work ability, get success from the fierce competition, and never worry about being fired.
  •  Save a lot of work time, leave much time for you to love and care the family and enjoy a comfortable life now.
  •  Reduce thousands of keyboard and mouse clicks every day, relieve your tired eyes and hands, and give you a healthy body.
  •  Become an Excel expert in 3 minutes, and get admiring glance from your colleagues or friends.
  •  No longer need to remember any painful formulas and VBA codes, have a relaxing and pleasant mind, give you a thrill you've never had before.
  •  Spend only $39, but worth than $4000 training of others. Being used by 110,000 elites and 300+ well-known companies.
  •  60-day unlimited free trial. 60-day money back guarantee. Free upgrade and support for 2 years. Buy once, use forever.
  •  Change the way you work now, and give you a better life immediately!

Office Tab Brings Efficient And Handy Tabs to Office (include Excel), Just Like Chrome, Firefox, And New IE

  • Increases your productivity by 50% when viewing and editing multiple documents.
  • Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
  • Open and create documents in new tabs of same window, rather than in new windows.
  • Help you work faster and easily stand out from the crowd! One second to switch between dozens of open documents!
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    Vinay · 2 years ago
    Thanks, This is very useful but what if I need to add some description in mail body before sending it. Please suggest the code.
  • To post as a guest, your comment is unpublished.
    Naman · 2 years ago
    Hi ,
    Very Nicely Explained.

    Instead of sending a new workbook can we only copy and paste the selected range into email body and send. I dont want to send the selected Range as Image. I want to send
    like a table view in body of the email. Can we do that??
  • To post as a guest, your comment is unpublished.
    Jacquelene · 3 years ago
    Very useful. Thank you .
    I have list of email address on the same sheet . When i clicked to one email address , the selected range of cells will be sent as attachment to this email. Can please help me on this?Many Thanks.
  • To post as a guest, your comment is unpublished.
    hemant · 3 years ago
    nice & useful ,good job!!!
  • To post as a guest, your comment is unpublished.
    shanu · 5 years ago
    Hi,

    Can you please let me know how to add signature and second introduction line to this mail for the second program.

    Thanks in advance.