VBA to make e-mail address in a cell to a hyperlink

G

Guest

I have a column that has e-mail addresses typed in each cell. If I place
the curser in the cell and hit return, Execl converts the address into a
hyperlink to where I can just click the cell and Outlook opens automatically
with the e-mail address in the "To:" box.

Is their a VBA that will convert each cell in the column to hyperlinks?
 
G

Guest

Shawn,

Here's one way:

Sub Test
Dim c As Range

With ActiveSheet
For Each c In Application.Intersect(.UsedRange, .Range("A:A"))
.Hyperlinks.Add anchor:=c, Address:="mailto:" & c.Value
Next c
End With

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

Top