I would like to loop through last row starting at A2.
Here is what I have so far:
Here is what I have so far:
VBA Code:
Sub Mail_test()
Dim OutApp As Object
Dim OutMail As Object
Dim LR As Long
Dim x As Long
test_top = "<html><head><title></title></head><body>" _
& "<style> table.main {border:2px solid black} " _
& "<style> table.schedule {border-collapse:collapse;border:1px solid black;} " _
& "<style> table.schedule td {border-collapse:collapse;border:1px solid black;} " _
& "<style> .href { font-size: 13px; font-family: calibri;}</style> " _
& "<table class=mainwidth:600px""><tr>" _
& "<center><spanfont-size:19px;"">" _
& "TITLE<br></span></center><br>" _
& "<spanfont-size:15px;"">" _
& "Text" _
& "<center><table class=""schedule""width:590px;""><tbodyfont-size:13px;"">" _
& "<tr align=""center"";style=""color:#c00000;"">" _
& "<td>header</td><td>header</td><td>header</td><td>header</td></tr>" _
test_bottom = "</tbody></table></center>" _
& "Text</table></body></html>" & .HTMLBody
LR = Cells(Rows.Count, 1).End(xlUp).Row
For x = 2 To LR
row = & "<tr><td>" & Range("A" & x) & "</td><td>text</td><td>text</td><td align=""center"">text</td></tr>" _
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
With OutMail
.Display
.HTMLBody = test_top & row (looping to LR in column A starting at A2) & test_bottom
End With
Set OutMail = Nothing
Set OutApp = Nothing
End Sub