Convert Existing Values in Range to Email Address Hyperlinks

reberryjr

Well-known Member
Joined
Mar 16, 2017
Messages
701
Office Version
  1. 365
Platform
  1. Windows
I was originally trying to format UserForm text box values, so that when they populate the worksheet, they're in a hyperlink format, but according to what I'm reading, that can't be done. So, I decided to just try and implement code that updates the range in the worksheet, when the worksheet is activated.

I'm getting an error of "Invalid or Unqualified Reference" error and the ".Hyperlinks" is being highlighted.

Code:
Private Sub Worksheet_Activate()

Dim cEmail As Range


For Each cell In Range(cEmail)
    .Hyperlinks.Add anchor:=cEmail, _
    Address:="mailto:" & cEmail.Value, _
    TextToDisplay:=cEmail


End Sub
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Glad we could help & thanks for the feedback
 
Upvote 0
Using the info you helped me with, I was able to also build a hyperlink to each Client's specific sheet, so the User doesn't have to scroll through the sheets trying to find it.

Code:
With ws1.Range("E" & NextRow)    .Hyperlinks.Add _
    anchor:=.Offset(), _
    Address:="", _
    SubAddress:="'" & Me.txt_ClientID.Value & "'!AW1", _
    TextToDisplay:=Me.txt_ClientID.Value
End With

This leaves me with 1 more challenge to figure out, then adding some error handling and some formatting, and I can call this complete. Woo Hoo!
 
Upvote 0

Forum statistics

Threads
1,215,558
Messages
6,125,511
Members
449,236
Latest member
Afua

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
Back
Top