hyperlink assistance please

samndi67

New Member
Joined
Feb 15, 2011
Messages
14
Good Afternoon All,

I have some VBA that sends an e-mail based on an address in a spreadsheet. It also sends a link to a survey form. My quetion is how do I convert the link to something like 'Click Here'? Each recipient gets a different link based on their customer number. The current link 'lives' in cell F. It is included in the Body.
Here's the code to send the e-mail and configure the body:

Code:
Sub SendEmail_Click()
'Create variables
Dim OutApp As Object
Dim OutMail As Object
Dim AW As Worksheet
Dim i As Integer
Dim Greeting As String
Set AW = ActiveSheet
On Error GoTo cleanup
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
With Application
.EnableEvents = False
.ScreenUpdating = False
End With
Do
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
'Create email
Greeting = "Please respond to our survey"
With OutMail
.To = AW.Range("C" & i).Value
.Subject = AW.Range("D" & i).Value
.Body = Greeting & vbNewLine & _
AW.Range("F" & i).Value & vbNewLine
 
'Send the e-mail
.Send
End With
i = i + 1
Loop Until IsEmpty(Cells(i, 1))
On Error GoTo 0
Set OutMail = Nothing
AW.AutoFilterMode = False
cleanup:
Set OutApp = Nothing
With Application
.EnableEvents = True
.ScreenUpdating = True
End With
End Sub

Thanks in Advance,
Sam
 

Some videos you may like

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)

Watch MrExcel Video

Forum statistics

Threads
1,122,216
Messages
5,594,886
Members
413,947
Latest member
gizmolucy

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
Top