Adding multiple emails to CC in VBa

Camz88

New Member
Joined
Nov 1, 2021
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hi, so, I am using the below VBA, but I can only add one email to CC, how do I add more than one.
Private Sub CheckBox1_Click()
Dim xOutlookObj As Object
Dim xOutApp As Object
Dim xOutMail As Object
Dim xMailBody As String
On Error Resume Next
Set xOutApp = CreateObject("Outlook.Application")
Set xOutMail = xOutApp.CreateItem(0)
xMailBody = "Hi" & vbNewLine & vbNewLine & _
"Cost Card attached is approved from me" & vbNewLine & _
"Thanks Lynette"
On Error Resume Next
With xOutMail
.To = "Email1@Hotmail.co.uk"
.CC = "Email2@Hotmail.co.uk" & "Email3@Hotmail.co.uk"
.BCC = ""
.Subject = "Cost Card Approved"
.Body = xMailBody
.Attachments.Add ActiveWorkbook.FullName
.Display 'or use .Send
End With
On Error GoTo 0
Set xOutMail = Nothing
Set xOutApp = Nothing
End Sub

Thanks for any help, and apologies if this has been asked before.

Mark
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Hi & Welcome to MrExcel!

What happens if you replace this line
Code:
.CC = "Email2@Hotmail.co.uk" & "Email3@Hotmail.co.uk"

with this line
Code:
.CC = "Email2@Hotmail.co.uk ; Email3@Hotmail.co.uk"
 
Upvote 0
Thankyou GWteB,

Very simple change, I could smell the fumes from my brain trying to see where I went wrong.

Have a good day.
 
Upvote 0

Forum statistics

Threads
1,214,644
Messages
6,120,709
Members
448,983
Latest member
Joaquim_Baptista

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