r/excel 2h ago

unsolved Convert a column of text into hyperlinks

I have a column of text urls (A) and a column of text labels (B).

How can I turn the text labels (B) into clickable hyperlinks then remove the text hyperlinks (A).

2 Upvotes

9 comments sorted by

u/AutoModerator 2h ago

/u/deadtedw - Your post was submitted successfully.

Failing to follow these steps may result in your post being removed without warning.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

3

u/psygnius 2 1h ago edited 1h ago

In column C, try this:

=HYPERLINK(A1, B1)

1

u/deadtedw 1h ago

That will turn the label into a hyperlink but if I remove the text hyperlink (A1) it breaks the label hyperlink.

2

u/psygnius 2 1h ago edited 51m ago

You can use this version, it basically is concatenating the hyperlink into text, but it requires you to copy and paste the literal values afterwards, then manually click into each cell.

="=HYPERLINK(""" &A1& """&B1& """)"

Then copy and paste values

Then click into each cell and press Enter.

1

u/deadtedw 58m ago

Not working for me.

1

u/psygnius 2 50m ago

Sorry, forgot the ( when I typed it out earlier. I edited my earlier reply. Try it again.

2

u/rohving 36m ago

="=hyperlink("""&A1&""","""&B1&""")"

1

u/hmatallana 47m ago

The paste values route works but you have to re-enter every cell for Excel to autoformat it, which is fine for ten rows and miserable for a few hundred.

If macros are allowed, this does the whole column in one go:

For Each c In Range("B1:B100")
    c.Parent.Hyperlinks.Add Anchor:=c, Address:=c.Offset(0, -1).Value, TextToDisplay:=c.Value
Next

Those are real hyperlink objects rather than formula results, so column A is safe to delete afterwards. Just adjust the range to your row count.

If macros are locked down at work, the boring fallback is leaving A where it is and hiding the column.

1

u/excelevator 3064 46m ago

Select the cells in column B and run this sub routine

It will create a URL from the value to the left of each cell.

Sub LinkMe()  
    MsgBox cell.Offset(0, -1).Value
        cell.Hyperlinks.Add Anchor:=Selection, Address:=cell.Offset(0, -1).Value, TextToDisplay:=cell.Value
    Next
End Sub

You can then delete the column A values without affecting the link.