RangetoHTML to include table headers

dshafique

Board Regular
Joined
Jun 19, 2017
Messages
171
Hi everyone, I have this program which automatically sends out an email to people who match a criteria in my spradsheet. the email includes a message and their corresponding row. is there a way for me to also include the table header as well?
this is what I have:

Code:
 With OutMail        .To = cl.Offset(0, 1).Value
        .CC = cl.Offset(0, 6).Value
        .BCC = ""
        .Subject = "CIO Scorecard - Finding Number " & cl.Offset(0, 3) & " Review For the Month of " & MonthName(Month(Date))
        .HTMLBody = "Hi Folks, " & "<br>" & "<br>" & _
        "Can you please take a look at the following Findings and advise whether it can be closed or extended? Reporting on expired items for the business review meeting on " & _
        Range("U2") & "<br>" & RangetoHTML(Range("A" & cl.Row, "L" & cl.Row)) & "<br>" & "<br>" & "Thanks"
        .Display
    End With

my table's name is IRI, i even tried adding
Code:
RangetoHTML(Range("IRI[#Headers]))
but the columns dont line up.

I'm new to using macros with outlook, any and all support would be greatly appreciated, thanks!
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
If you want to get the entire table you can use Sheets("Sheet1").ListObjects("IRI").Range, changing Sheet1 for the appropriate sheet name.
 
Upvote 0
so im not necessarily trying to get the whole table, each person has a row assigned to them, and I only want them to see that row and the header of the tables.
 
Upvote 0

Forum statistics

Threads
1,223,904
Messages
6,175,295
Members
452,633
Latest member
DougMo

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