Good morning,
I have VBA coding that sends an email to a specific person depending on what name is entered into a form.
I want to be able to add a link within the email that will take the recipient to a specific spreadsheet, the link is different for each person,. The link to be placed in the text body comes from cell AM22.
I have the following code, it sends everything that i need it to apart from a workable link, currently it is just populating the text from AM22 (not showing as a link)
Sub email_from_excel_basic()
Dim emailapplication As Object
Dim emailitem As Object
Dim link As String
Set emailapplication = CreateObject("Outlook.Application")
Set emailitem = emailapplication.createitem(0)
' build the email
emailitem.to = Range("Handover!D9").Value
emailitem.Subject = "Handover Created."
emailitem.Body = "Handover created to carry out the following:" & vbNewLine & vbNewLine & Range("Handover!AL17").Value & " " & Range("Handover!AM17").Value & vbNewLine & Range("Handover!AL18").Value & " " & Range("Handover!AM18").Value & vbNewLine & Range("Handover!AL19").Value & " " & Range("Handover!AM19").Value & vbNewLine & Range("Handover!AL20").Value & " " & Range("Handover!AM20").Value & vbNewLine & Range("Handover!AL21").Value & " " & Range("Handover!AM21").Value & vbNewLine & Range("Handover!AL22").Value & " " & Range("Handover!AM22").Value
' send the email
emailitem.send
Set emailitem = Nothing
Set emailapplication = Nothing
End Sub
Administrator's note: Please take the time to review our rules. There aren't many, and they are all important. Our guidelines recommend code tags. I have added them for you this time because you are a new member. --6StringJazzer
Very new to VBA and any guidance would be greatly appreciated.
Scott
Bookmarks