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

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
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,215,148
Messages
6,123,300
Members
449,095
Latest member
Chestertim

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