Associate name with email

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a column of names and a column of email addresses. Is there any way
to merger them into a single hyperlink that shows the name and sends to the
email address?
 
Hi jswafa

Try this : With the names in column A and the E-mail addresses in column B try this

Sub test()
For Each myCell In Columns("B").Cells.SpecialCells(xlCellTypeConstants)
If myCell.Value Like "?*@?*.?*" Then
ActiveSheet.Hyperlinks.Add Anchor:=myCell.Offset(0, -1), _
Address:="mailto:" & myCell.Value, TextToDisplay:=myCell.Offset(0, -1).Value
End If
Next
End Sub
 
Worked great, Ron - thanks for the tip!

Ron de Bruin said:
Hi jswafa

Try this : With the names in column A and the E-mail addresses in column B try this

Sub test()
For Each myCell In Columns("B").Cells.SpecialCells(xlCellTypeConstants)
If myCell.Value Like "?*@?*.?*" Then
ActiveSheet.Hyperlinks.Add Anchor:=myCell.Offset(0, -1), _
Address:="mailto:" & myCell.Value, TextToDisplay:=myCell.Offset(0, -1).Value
End If
Next
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top