David A.
David A.

Reputation: 11

Combining Text and Hyperlink Into Text that is Hyperlinked

I have text in column A and URLs in column B.

I want the merged A&B shown in column C.

Example:

Column A | Column B | Column C
Product 1 | google_dot_com | Product 1 (with hyperlink to url)
Product 2 | yahoo_dot_com | Product 2 (with hyperlink to url)
Product 3 | stackoverflow_dot_com | Product 3 (with hyperlink to url)

Here is an image. https://i.sstatic.net/IuUUh.jpg

This is different from just referencing the cells and using the HYPERLINK(A1,B1) and then copying it down column C.

Here is a small test file I created that you can download if my above example wasn't clear enough. http://www.filedropper.com/stacker-help

Using Microsoft Office Professional Plus 2013, Windows 7

Upvotes: 1

Views: 23541

Answers (3)

Excel
Excel

Reputation: 269

=HYPERLINK(B2,A2) should work as per your image requirement. Please check

store the link(column B) in text format

enter image description here

Upvotes: 3

David A.
David A.

Reputation: 11

I have found the answer I was looking for, here is the VBA code I used.

Sub MergingCells()
For i = 2 To Range("a1").End(xlDown).Row
Sheets("sheet1").Hyperlinks.Add anchor:=Cells(i, 3), Address:="http://" &     Cells(i,     2).Value, TextToDisplay:=Cells(i, 1).Value
Next i
End Sub

Upvotes: 0

hinneLinks
hinneLinks

Reputation: 3736

Use the CONCATENATE-Funktion in Excel, e.g.=CONCATENATE(A1;B1). If you need the square bracets just add them in eg.g =CONCATENATE(A1;"[";B1;"]").

The function-names in Excel depend on your language, you might have to use a translated version (in Germany 'VERKETTEN', other languages see http://en.excel-translator.de/CONCATENATE/). And it gets better: in german you need ";" to seperate the parameters, in english it's a ",".

Translating funktion-names like in Excel should be considered a crime.

Upvotes: 1

Related Questions