Table VBA code help for email

Patriot2879

Well-known Member
Joined
Feb 1, 2018
Messages
1,227
Office Version
  1. 2010
Platform
  1. Windows
Hi i hope you can help me please i have the table below which is a bit messy at moment as it is not alligned neatly as the bottom row is long than the 1st and 2nd row, i have tried amending but it caused an error, and i also want to add another line to the code but it says i have added to much, the new line i want to add is
Code:
"<th>Late Raises:</th>" & "<td>" & Worksheets("Handover").Range("F9").Value & "</td>" &
VBA Code:
   aEmail.htmlBody = "<html>" & _
                    "<p>Hi All, good afternoon,</p>" & _
                    "<p><u><b>" & Me.TextBox4.Value & "</p></u></b>" & _
                    "<table border=""1"", cellpadding=""18"", style=background:""#a6bbde"" >" & _
                "<tr>" & _
                    "<th>NCMO Issue:</th>" & "<td>" & Worksheets("Handover").Range("C5").Value & "</td>" & "<th>Re-Raised:</th>" & "<td>" & Worksheets("Handover").Range("F5").Value & "</td>" & _
                    "</tr>" & _
                "<tr>" & _
                    "<th>SNR:</th>" & "<td>" & Worksheets("Handover").Range("C6").Value & "</td>" & "<th>Additional Jobs:</th>" & "<td>" & Worksheets("Handover").Range("F6").Value & "</td>" & _
                    "</tr>" & _
                "<tr>" & _
                    "<th>Replans:</th>" & "<td>" & Worksheets("Handover").Range("C7").Value & "</td>" & "<th>Incorrectly Booked:</th>" & "<td>" & Worksheets("Handover").Range("F7").Value & "</td>" & "<th>IGT Issue:</th>" & "<td>" & Worksheets("Handover").Range("C9").Value & "</td>" & "<th>Outages:</th>" & "<td>" & Worksheets("Handover").Range("c8").Value & "</td>" & _
                    "</tr>" & _
                    "</table>" & _
                "" & _
 
Hi this works great now many thanks for your help much appreciated.
 
Upvote 0

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.

Forum statistics

Threads
1,214,885
Messages
6,122,085
Members
449,064
Latest member
MattDRT

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