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
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