Hi all, I'm trying to create a macro to open (but not send) multiple emails at a time. I'm hardly an expert with macros but I'm working my way through this to make a small part of my job a little easier and this works except for one relatively small aspect. I've posted the code below -- I need the part that is & "<br><b>Opportunity:   </b>" & Range("E" & r).Value & "" _ to open in the email as a hyperlink as the actual cell values in column E are URLs. It's fine if the text for the link is just the URL, but ideally it will appear in the email as a link. So in the new email that pops up it should look like:
Opportunity: https://blahblahblah.com
I know this isn't a huge deal and I can just enter a space after the URL once the new email opens in Outlook and it'll become a link but if I'm going to do this, I want to try and go all the way with it.
Opportunity: https://blahblahblah.com
I know this isn't a huge deal and I can just enter a space after the URL once the new email opens in Outlook and it'll become a link but if I'm going to do this, I want to try and go all the way with it.
VBA Code:
Sub SendMultipleEmails()
Dim OutApp As Object, OutMail As Object, lastRow As Integer, r As Integer
Dim bodyHeader As String, bodyMain As String, bodySignature As String
Set OutApp = CreateObject("Outlook.Application")
lastRow = Cells(Rows.Count, "B").End(xlUp).Row
For r = 2 To lastRow
Set OutMail = OutApp.CreateItem(0)
With OutMail
.To = Range("B" & r).Value
.Subject = Range("C" & r).Value & " - " & Range("D" & r).Value & " " & Range("F" & r).Value & " " & Range("G" & r).Value & " " & Range("H" & r).Value & " - " & Range("I" & r).Value
.HTMLBody = "Hello team, <P>Please create CPQs for <b>" & Range("D" & r).Value & "</b> using the attached " & Range("F" & r).Value & " " & Range("G" & r).Value _
& " proposal. This is a " & Range("H" & r).Value & "." _
& "<br><b>Opportunity:   </b>" & Range("E" & r).Value & "" _
.Display
End With
Next r
Set OutMail = Nothing
Set OutApp = Nothing
End Sub