+ Reply to Thread
Results 1 to 4 of 4

macro that make hyperlink?

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    05-10-2011
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    145

    macro that make hyperlink?

    Hey guys
    I am trying to turn a url string into a clickable hyperlink, using the following macro:


    Public Sub Convert_To_Hyperlinks()
        Dim Cell As Range
        For Each Cell In Intersect(Selection, ActiveSheet.UsedRange)
            If Cell <> "" Then
                ActiveSheet.Hyperlinks.Add Cell, Cell.Value
            End If
        Next
    End Sub

    the problem is that instead of making a link like this http://example.com I am getting a link like this file:///C\users\deski\desktop\example.com

    See file attached

    How can I fix that? thx a lot!
    Attached Images Attached Images
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    05-10-2011
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    145

    Re: macro that make hyperlink?

    can anyone help?

  3. #3
    Valued Forum Contributor mohd9876's Avatar
    Join Date
    05-04-2011
    Location
    Amman, Jordan
    MS-Off Ver
    Excel 2010
    Posts
    426

    Re: macro that make hyperlink?

    the workbook you attached is empty, please re attach the one at which the problem occurs

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: macro that make hyperlink?

    Something like this works for me. Depends what's actually in the cells

    Public Sub Convert_To_Hyperlinks()
        Dim Cell As Range
        For Each Cell In Intersect(Selection, ActiveSheet.UsedRange).SpecialCells(xlCellTypeConstants)
                Cell.Hyperlinks.Add Cell, Cell.Value
        Next
    End Sub
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

+ 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