HYPERLINK - How to add a hyperlink to a cell and use the original cell value as the hyperlink text? Arrrgggghhh!!!

jswhip

Board Regular
Joined
Jan 19, 2005
Messages
69
Looping through a worksheet and want to:
1. For each row in Column A, want to add a hyperlink (easy enough)
2. For the hyperlink text, I want to use the value that was originally in column A
3. Storing the original value in a text variable, but can't get the text value to display

I've tried countless iterations of double quotes, ampersands, etc, but without success. Here is what I have so far ("DealName" shows up as the hyperlink text, not the value of the string variable).

Sub test()

Dim x, LastCellRow As Integer
Dim DealName As String

LastCellRow = Cells(65536, 3).End(xlUp).Row

For x = LastCellRow To 3 Step -1

DealName = Cells(x, 1)
Cells(x, 1).FormulaR1C1 = "=HYPERLINK(""https://apps.trepp.com/abpw/w/dealsumm.cgi?cusip=""&RC3,""DealName"")"

Next x

Thanks!

Capture.JPG
End Sub
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Try:

VBA Code:
Cells(x, 1).FormulaR1C1 = "=HYPERLINK(""https://apps.trepp.com/abpw/w/dealsumm.cgi?cusip=""&RC3,""" & DealName & """)"
 
Upvote 0
Solution

Forum statistics

Threads
1,224,818
Messages
6,181,152
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top