Reecenorman1996
New Member
- Joined
- Jul 20, 2023
- Messages
- 31
- Office Version
- 365
- Platform
- Windows
Hi need help editing the below code to let me send the email to 2 people in cc in 2 columns at the moment its gets the cc form column k, but i want it to get email addresses from j and k and have 2 people in copy
thanks in advance
Sub Send_Bulk_Mails()
Dim sh As Worksheet
Set sh = ThisWorkbook.Sheets("sheet1")
Dim i As Integer
Dim OA As Object
Dim msg As Object
Set OA = CreateObject("outlook.application")
Dim last_row As Integer
last_row = Application.CountA(sh.Range("c:c"))
For i = 2 To last_row
Set msg = OA.createitem(0)
msg.to = sh.Range("i" & i).Value
msg.cc = sh.Range("k" & i).Value
msg.Subject = sh.Range("m" & i).Value
msg.Body = sh.Range("n" & i).Value
msg.send
sh.Range("p" & i).Value = "Sent"
Next i
MsgBox "All emails have been sent"
End Sub
thanks in advance
Sub Send_Bulk_Mails()
Dim sh As Worksheet
Set sh = ThisWorkbook.Sheets("sheet1")
Dim i As Integer
Dim OA As Object
Dim msg As Object
Set OA = CreateObject("outlook.application")
Dim last_row As Integer
last_row = Application.CountA(sh.Range("c:c"))
For i = 2 To last_row
Set msg = OA.createitem(0)
msg.to = sh.Range("i" & i).Value
msg.cc = sh.Range("k" & i).Value
msg.Subject = sh.Range("m" & i).Value
msg.Body = sh.Range("n" & i).Value
msg.send
sh.Range("p" & i).Value = "Sent"
Next i
MsgBox "All emails have been sent"
End Sub