ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA to make e-mail address in a cell to a hyperlink (https://www.excelbanter.com/excel-programming/394855-vba-make-e-mail-address-cell-hyperlink.html)

Shawn

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


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?


--
Thanks
Shawn

Vergel Adriano

VBA to make e-mail address in a cell to a hyperlink
 
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

--
Hope that helps.

Vergel Adriano


"Shawn" wrote:



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?


--
Thanks
Shawn



All times are GMT +1. The time now is 10:26 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com