I need to add a cc column to the email code that I have. I have an email that, once the button ("Send Return Due Date Email") is pushed it looks for anything with current date and sends an email to a specific person, but I need to be able to copy the technician in on the email. The technician names change based upon who has the part at that time. The code to send the email is: I'm not sure what to add to the Macro. I have also attached the file. The button for the email is on the Tools page as well as who the technician is (column I) and the email addresses are on the Indexes page in Columns AF:AG.
Sub Mail_small_Text_Outlook()
Dim OutApp As Object
Dim OutMail As Object
Dim strbody As String
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
' -- CREATE BODY OF EMAIL PORTION START -----------------------
strbody = "The Items listed below are expected to be returned to inventory today , " & Date & vbNewLine & vbNewLine
Dim cell As Range
Dim numRows As Integer
' Find out number of rows:
numRows = Range("B6", Range("B6").End(xlDown)).Rows.Count
' Check each cell in Return Due Date and see if it matches today
For Each cell In Range("M6:M" & numRows)
If cell.Value = Date Then
strbody = strbody & cell.Offset(0, -11).Value & vbNewLine
End If
Next
' -- CREATE BODY OF EMAIL PORTION END ------------------------
On Error Resume Next
With OutMail
.to = "cinstanl@hotmail.com"
.cc =
.Subject = "Inventory Due Today"
.Body = strbody
.Display
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
' Update date on sheet:
shtInventoryList.Range("K3").Value = Date & " at " & Time
End Sub
Bookmarks