+ Reply to Thread
Results 1 to 3 of 3

Creation of bulk Mailto hyperlinks

Hybrid View

  1. #1
    Registered User
    Join Date
    10-05-2009
    Location
    NJ
    MS-Off Ver
    Excel 2007
    Posts
    1

    Creation of bulk Mailto hyperlinks

    Dear listmates,

    I would like to start off with apologizing for the newbie post. I need some assistance in writing a macro that will enable me to create mailto links in any particularly selected columns.

    I have excel ss that have plain text email addresses in one colume, in hundreds of rows. If I could write a macro that would simply create mailto hyperlinks in the selected column that would help me avoid manually creating for each email address.

    Thanks a bunch in advance.

    Jay

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Creation of bulk Mailto hyperlinks

    Really need a macro?

    If there is a plaintext email address in A1,

    =HYPERLINK("mailto:" & A1, "Email")
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Creation of bulk Mailto hyperlinks

    You could use the HYPERLINK function in adjacent cells ?

    B1: =HYPERLINK("mailto:"&A1&"?subject=Subject&Body=Hello",A1)

    If you do want VBA then assuming existing values are constants (curious as to why they're not already hyperlinks by default) then

    Public Sub Example()
    Dim rngCell As Range
    For Each rngCell In Selection.SpecialCells(xlCellTypeConstants)
        With rngCell
            If .Hyperlinks.Count Then .Hyperlinks(1).Delete
            .Hyperlinks.Add rngCell, "mailto:" & rngCell.Value, , , rngCell.Value
        End With
    Next rngCell
    End Sub

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1