Avatar of Jerry L
Jerry L
Flag for United States of America asked on

Excel - How to Add Hyperlink to Plain Text

Excel 2013
Windows 7

I have a list of names and dates all in one column that include hyperlinks. I expanded the contents of each cell to multiple columns. But, in doing so, I lost the hyperlinks.

I need a formula or Macro that takes the hyperlink from one cell in COL A and applies it to the adjacent cell in COL B, but I need to be able to tell it what SRC column and what DEST column to use; it's not always A and B.

NOTE: Only the first cell of the expanded data needs the hyperlink.

Original Data - This shows the first Column that contains the original data and the adjacent Columns that have been expanded - (copy/paste this sample data to your Excel spreadsheet and then add any hyperlink by hand to first Column cells for testing)

NOTE: To retain the proper layout in Excel, you may need to paste the code first into a plain text editor such as Notepad, then copy and paste into Excel.
Last2, First2 (1079-1142)	Last2	First2	1079	1142
First3 Last3, (1098-1179)	First3 Last3		1098	1179
Last1, First1 (1986)	Last1	First1		1986
Last4, (1983)	Last4			1983

Open in new window

The result should be that the first cell in the adjacent data will contain the hyperlink from it's source cell on the left. For example, "Last2" in Cell B1 will contain the hyperlink from "Last2, First2 (1079-1142)" in Cell A1.
Microsoft ExcelVB ScriptMicrosoft OfficeVBA

Avatar of undefined
Last Comment
Jerry L

8/22/2022 - Mon
Jerry L

View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck