So, it would end up looking at values within the arrComplaint array:
Public Sub SendEMail(ByVal rngStart As Excel.Range)
Dim arrComplaint As Variant
arrComplaint = rngStart.Resize(1, 20).Value
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
With OutMail
.To = ""
.CC = ""
.BCC = ""
.Subject = "Complaint ID" & cstr(arrComplaint(1,1))
.Body = "Complaint ID " & cstr(arrComplaint(1,1)) & " has no progress for 5 days"
.Display
End With
On Error GoTo 0
With Application
.EnableEvents = True
.ScreenUpdating = True
End With
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
You would change the second 1 to bring up different columns from the database, i.e.:
arrcomplaint(1,8)
would show the department.
Bookmarks