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

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
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,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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