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
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,899
Messages
5,834,299
Members
430,275
Latest member
Halis

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