• is there an automated procedure for…

    Author
    Topic
    #462829

    Hi All,

    I could use a little help here. I have a rather large excel file that has a column of email addresses that are all text. I need to convert them all to actual email hyperlinks so that when I click on them it fires up my outlook. Is there an automated procedure for doing this that will make my task easier. I am assuming that some sort of macro or vb script can be generated but that is a bit beyond my ability.

    Thanks for any assistance. I am attaching a sample.

    Viewing 0 reply threads
    Author
    Replies
    • #1179238

      The following macro should do what you want:

      Code:
      Sub Convert2Hyperlinks()
        Dim oCell As Range
        For Each oCell In ActiveSheet.UsedRange
      	If InStr(oCell.Value, "@") > 0 Then
      	  ActiveSheet.Hyperlinks.Add Anchor:=oCell, Address:="mailto:" & oCell.Value
      	End If
        Next oCell
      End Sub
      • #1179243

        The following macro should do what you want:

        Code:
        Sub Convert2Hyperlinks()
          Dim oCell As Range
          For Each oCell In ActiveSheet.UsedRange
        	If InStr(oCell.Value, "@") > 0 Then
        	  ActiveSheet.Hyperlinks.Add Anchor:=oCell, Address:="mailto:" & oCell.Value
        	End If
          Next oCell
        End Sub

        Thank you Hans! That worked perfectly (of course)! As always the assistance provided here in the Lounge is the best.

        Here is a cold one for you!

    Viewing 0 reply threads
    Reply To: is there an automated procedure for…

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: