Send range of cell to multiple recipients in Excel

rbarrera05

New Member
Joined
Sep 24, 2016
Messages
3
I have a range of table range("A1:B12") in Excel. I was able to send the table to one recipient only.
However, I wanted to send the table to multiple recipient. Emails can be found in column B.

Here's my initial macro code (this code will send the table only send to 1 recipient)
Sub Send_Range()
' Select the range of cells on the active worksheet.
ActiveSheet.Range("A1:E12").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
.Introduction = "This is a sample workshee."
.Item.To = "ryan.c.barrera@ctt.com" 'send to only one recipient

.Item.Subject = "My subject"
.Item.Send
End With


End Sub
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Separate the email addresses with semicolons?
 
Upvote 0
Something like this:

Code:
Sub Send_Range()
ActiveSheet.[c1:e12].Select
ActiveWorkbook.EnvelopeVisible = 1
With ActiveSheet.MailEnvelope
    .Item.To = GetClip
    .Introduction = "This is a sample worksheet."
    .Item.Subject = "My subject"
    '.Item.Send
End With
End Sub


Function GetClip$()
Dim dto As DataObject
Set dto = New DataObject
On Error GoTo NotText
Range("b1:b" & Range("b" & Rows.Count).End(xlUp).Row).Copy      ' the emails
dto.GetFromClipboard
GetClip = Replace(dto.GetText(1), vbNewLine, ";")               ' add semicolons
NotText:
If Err <> 0 Then MsgBox "Data on clipboard is not text."
End Function
 
Upvote 0
You are welcome.
I’m Sir Worf, a mighty Klingon warrior… :eek:
Now seriously, note that one interesting feature of that code is that it has no looping.
 
Upvote 0

Forum statistics

Threads
1,214,376
Messages
6,119,179
Members
448,871
Latest member
hengshankouniuniu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top