Excel VBA: Email List of Tasks Assigned To A User

JonnieO

New Member
Joined
Jul 18, 2017
Messages
17
I created a project task spreadsheet that has a GANTT chart as a part of it using formulas and conditional formatting. It works rather well for tracking tasks, their completion %, task owner, etc. There are several "sections" that list tasks which fall under that classification.

Every Tuesday I send an email to each person with an assigned task and in the body of the email I copy and paste the rows assigned to the user I'm emailing at the time, asking for updates prior to the project meeting on the upcoming Friday.

I want to have Excel grab the email address of the user assigned to the task, also copy each row that contains tasks they are assigned to, paste that that into the body of an email (along with a small blurb about providing updates), then send that email. As I said, right now I do all of that manually, which is taking too much time with the other responsibilities that I've been given.

Any help you can provide would be great. Thank you for taking time to read this.
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
If you set your data where AutoFilter gets what you need, that makes it easier. The chart is best sent as an attachment I think.

Here is an example. Set the reference as commented. Add the routine from Ron de Bruin's site as well. Change To, Subject, and such to suit.
Code:
Sub SendToOutlook1()
  'Tools > References > Microsoft Outlook xx.0 Object Library
  Dim olApp As Outlook.Application, olMail As Outlook.MailItem
  Dim sig$
  
  Set olApp = New Outlook.Application
  Set olMail = olApp.CreateItem(olMailItem)
  With olMail
    .Display
    sig = .HTMLBody
    .To = "ken@gmail.com"
    .Subject = "Restaurant Summary Report"
    'http://www.rondebruin.nl/win/s1/outlook/bmail2.htm
    .HTMLBody = RangetoHTML([A1:H22]) & sig
    .Display
    '.Send
  End With
  Set olMail = Nothing
  Set olApp = Nothing
End Sub
 
Upvote 0
Thanks Kenneth, this help to get me on the right track. I am light years closer now than I was with this.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

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