Help adjusting Macro to email multiple cc addresses

The Ruff Report

New Member
Joined
Jun 17, 2023
Messages
21
Office Version
  1. 365
Platform
  1. Windows
Looking for some help. This macro works but I want to cc multiple email addresses (up to 7) instead of just the one cc address in cell C2.
-----------------------------------------------------------
Dim OutApp As Object
Dim OutMail As Object
Dim EmailSubject As String
Dim EmailSendTo As String
Dim MailBody As String
Dim cell As Range


Path = "C:\Users\bobb\Desktop\Reports\"
Set Rng = Range(Range("B2"), Range("B" & Rows.Count).End(xlUp))

For Each cell In Rng
Rw = cell.Row
If cell.Value <> "" Then
EmailSendTo = cell.Value
Company = cell.Offset(0, -1)
ccTo = cell.Offset(0, 1)
AttachFileName = Path & cell.Offset(0, 8).Value

'Email Subject
EmailSubject = "12 2023 Receipts"

'Mail Body string

strbody = "Good Morning," & vbNewLine & vbNewLine & _
"Attached are receipts." & vbNewLine & _
"Thanks," & vbNewLine & _
"Bob"

'Send Mail
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(o)
With OutMail
.Subject = EmailSubject
.To = EmailSendTo
.CC = ccTo
.SentOnBehalfOfName = "bobb@mycompany.com"
.Body = strbody
.Attachments.Add (AttachFileName)
.Display
End With

Set OutMail = Nothing
Set OutApp = Nothing
strbody = ""

End If
Next

End Sub
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Also just as good: get rid of cc and Send To email addresses in B2 to H2. Note some rows will have one address, some rows eight.
 
Upvote 0

Forum statistics

Threads
1,224,815
Messages
6,181,136
Members
453,021
Latest member
Justyna P

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