CheeseBurger5
New Member
- Joined
- Apr 18, 2021
- Messages
- 1
- Office Version
- 365
- Platform
- Windows
Hi, guys,
I need some help. I am trying to create a macro where the all pending tasks for one person, one e-mail, will be included in one outlook e-mail. Basically the program will search for the pending tasks, group them all and send it to the e-mail of the person it is assigned to.
I was able to modify/create a code where the pending task reminders are sent automatically, but it is sending one task per e-mail. Even if it is the same person, it will still create a separate e-mail. So... this kinda floods the person with different and multiple pending reminders hahahahaha! That's why I thought is it possible to have one e-mail reminder, and it includes all the pending tasks for that one person already? This way I will be able to send reminders, AND not flood the person with multiple pending tasks hahahaha! Here's what I have...
Sub Reminder()
Dim wStat As Range, i As Long
Dim dam As Object
For Each wStat In Range("D6", Range("D" & Rows.Count).End(xlUp))
If wStat.Value = "Pending" Then
i = wStat.Row
If Cells(i, "I").Value <= Range("I3").Value Then
Set dam = CreateObject("Outlook.Application").CreateItem(0)
dam.To = Range("L" & i).Value
dam.CC = Range("L" & i).Value
dam.Subject = Range("B" & i).Value
dam.Body = "Dear " & Range("E" & i).Value & "," & vbCr & vbCr & _
"This is to remind you that the task: " & Range("B" & wStat.Row).Value & " - " & " " & _
"is still pending." & vbCr & vbCr & _
"Thank you!"
'
dam.Send 'change send to display if you want to check
wStat.Value = "Pending"
End If
End If
Next
MsgBox "Reminders Sent!"
End Sub
The outlook looks like this now (Separate outlook window, same e-mail, different tasks)
I want it to look like this (One outlook window, same e-mail, different tasks included in that window)
Can anyone help please? Any help would be appreciated! Thank you!
I need some help. I am trying to create a macro where the all pending tasks for one person, one e-mail, will be included in one outlook e-mail. Basically the program will search for the pending tasks, group them all and send it to the e-mail of the person it is assigned to.
I was able to modify/create a code where the pending task reminders are sent automatically, but it is sending one task per e-mail. Even if it is the same person, it will still create a separate e-mail. So... this kinda floods the person with different and multiple pending reminders hahahahaha! That's why I thought is it possible to have one e-mail reminder, and it includes all the pending tasks for that one person already? This way I will be able to send reminders, AND not flood the person with multiple pending tasks hahahaha! Here's what I have...
Sub Reminder()
Dim wStat As Range, i As Long
Dim dam As Object
For Each wStat In Range("D6", Range("D" & Rows.Count).End(xlUp))
If wStat.Value = "Pending" Then
i = wStat.Row
If Cells(i, "I").Value <= Range("I3").Value Then
Set dam = CreateObject("Outlook.Application").CreateItem(0)
dam.To = Range("L" & i).Value
dam.CC = Range("L" & i).Value
dam.Subject = Range("B" & i).Value
dam.Body = "Dear " & Range("E" & i).Value & "," & vbCr & vbCr & _
"This is to remind you that the task: " & Range("B" & wStat.Row).Value & " - " & " " & _
"is still pending." & vbCr & vbCr & _
"Thank you!"
'
dam.Send 'change send to display if you want to check
wStat.Value = "Pending"
End If
End If
Next
MsgBox "Reminders Sent!"
End Sub
The outlook looks like this now (Separate outlook window, same e-mail, different tasks)
I want it to look like this (One outlook window, same e-mail, different tasks included in that window)
Can anyone help please? Any help would be appreciated! Thank you!