Share via

Convert text to hyperlinks

Anonymous
2016-02-04T18:47:08+00:00

I have a list of web urls (432k). I have been trying to convert them all to active hyperlinks but I keep getting the same error (pictured below). I have used the following codes (provided below).

Public Sub Convert_To_Hyperlinks()

    Dim Cell As Range

    For Each Cell In Intersect(Selection, ActiveSheet.UsedRange)

        If Cell <> "" Then

            ActiveSheet.Hyperlinks.Add Cell, Trim(Cell.Value)

        End If

    Next

End Sub

Sub HyperAdd()

' Converts each text hyperlink selected into a working hyperlink

    For Each xCell In Selection

        ActiveSheet.Hyperlinks.Add Anchor:=xCell, Address:=xCell.Formula

    Next xCell

End Sub

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2016-02-05T18:01:46+00:00

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

    If Target.Column = 9 Then

        With Target.Columns(1)

            .Offset(0, 13).Value = Date

            .Offset(0, 14).Value = Time

        End With

    End If

    If Target.Cells.Count > 1 Then Exit Sub

    If Target.Column = 5 Then

        Application.DisplayAlerts = False

        ActiveWorkbook.FollowHyperlink Address:=Target.Value, NewWindow:=True

        'ActiveWorkbook.FollowHyperlink Address:="http:\" & Target.Value, NewWindow:=True

        Application.DisplayAlerts = True

    End If

End Sub

Was this answer helpful?

0 comments No comments

8 additional answers

Sort by: Most helpful
  1. Anonymous
    2016-02-05T14:25:08+00:00

    Thanx!

    Could you happen to help me out with that? URL's are in column E. 

    "convert each cell to a link or follow the link when the cell is selected, using the worksheet's selection change event"

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2016-02-04T21:41:18+00:00

    No - 8 sheets should be enough for that many links.  Or you could convert each cell to a link or follow the link when the cell is selected, using the worksheet's selection change event, rather than have each cell contain an active link.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2016-02-04T20:06:03+00:00

    Wow. Well, that would explain it. Being that Excel now supports 1048576 rows, is there a way around this?

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2016-02-04T19:26:27+00:00

    There is nothing inherently wrong with your code - maybe the error is because Excel can only have 66,530 hyperlinks on a single sheet.

    Was this answer helpful?

    0 comments No comments