Table Border : HTML Email

Deepak Sahtani

New Member
Joined
Feb 17, 2016
Messages
4
Hi, I am using a function to copy excel values to outlook 2010 email, , I would like to add a border next to each cell value so that it looks like a table in the HTML email, could you please help! Thanks in advance

The code is :

Dim cashcolumn As Range, cashrow As Range, r As Range, c As Range
Dim str As String
Sheet5.Activate

Set cashcolumn = Range("A1", Range("A1").End(xlDown))



str = "<p style='color: black;font-family:calibri;font-size:14.5'><table>"

For Each r In cashcolumn

str = str & "<p style='color: black;font-family:calibri;font-size:14.5><tr>"
Set cashrow = Range(r, r.End(xlToRight))

For Each c In cashrow
str = str & "<p style='color: black;font-family:calibri;font-size:14.5'><td>" & c.Text & "</td>"
Next c

str = str & "</tr>"

Next r
str = str & "</table>"
opencash = str



End Function
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.

Forum statistics

Threads
1,214,784
Messages
6,121,538
Members
449,038
Latest member
Guest1337

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