Patriot2879
Well-known Member
- Joined
- Feb 1, 2018
- Messages
- 1,259
- Office Version
- 2010
- Platform
- Windows
hi all,good morning. I hope you can help me please? I have the code, where it copies from spreadsheet and pastes into an email, but I would like to have a wrap text for when its transferred into the email, can you help please?
this is the whole code
HTML:
With Sheets("Handover")
Set rngDataToEmail = .Range("H4:R" & .Range("H" & Rows.Count).End(xlUp).Row)
End With
this is the whole code
HTML:
Private Sub CommandButton4_Click()
Dim aOutlook As Object
Dim aEmail As Object
Dim rngeAddresses As Range, rngeCell As Range, strRecipients As String
Dim rngDataToEmail As Range
Set aOutlook = CreateObject("Outlook.Application")
Set aEmail = aOutlook.CreateItem(0)
With Sheets("Handover")
Set rngDataToEmail = .Range("H4:R" & .Range("H" & Rows.Count).End(xlUp).Row)
End With
aEmail.HTMLBody = "<html>" & _
"<p>Hi Paul/Jayne, good afternoon, <p>In day today there was an additional " & Worksheets("Handover").Range("F6").Value & " jobs raised in the system by myself to try and fill the guys up- escalations/sites brought forward. (This does not include the raising of duplicate jobs where work was raised incorrectly or needed to be re-raised due to technical fault)." & Worksheets("Handover").Range("F8").Value & "</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>Rebinds:</th>" & "<td>" & Worksheets("Handover").Range("F7").Value & "</td>" & "<th>Outages:</th>" & "<td>" & Worksheets("Handover").Range("c8").Value & "</td>" & _
"</tr>" & _
"</table>" & _
"" & _
"<p><u><b>" & Me.TextBox5.Value & "</p></u></b>" & _
"<p>" & Me.TextBox1.Value & "</p>" & _
"<p><u><b>" & Me.TextBox6.Value & "</p></u></b>" & _
"<p>" & Me.TextBox2.Value & "</p>" & _
"<p><u><b>" & Me.TextBox7.Value & "</p></u></b>" & _
"<p>" & Me.TextBox3.Value & "</p>" & RangetoHTML(rngDataToEmail) & _
"<p>Many Thanks</p>" & _
"<p>New Connections Team</p>" & _
"</body></html>"
aEmail.Recipients.Add (Worksheets("Email Links").Range("B2").Value)
aEmail.CC = (Worksheets("Email Links").Range("C2").Value)
aEmail.BCC = ""
aEmail.Subject = "" & Range("C1").Value & " " & Range("K1").Value
aEmail.Display
End Sub