I have a table full of Hyperlinked text in excel, so it\'s basically a bunch of names but when I click on one, it takes me to some URL in my default browser.
So I am
I just ran into this issue and this is what worked for me:
I used the FormulaR1C1 extension method for a range. So my code looked like this:
for (int r = 2; r <= sheetRange.Rows.Count; r++)
{
documentRecord = new List<string>();
for (int c = 1; c <= wkCol; c++)
{
documentRecord.Add(sheetRange.Cells[r, c].FormulaR1C1);
}
AllRecords.Add(documentRecord);
}
When the record is added to the list of records, the value of whatever the cell range was is formatted into a clickable-hyperlink.
You can use VBA code to achieve this.
Press Alt
+ F11
to open VB editor, Insert a Module
and paste the code below:
Sub run()
On Error Resume Next
For Each hLink In Selection
Range(hLink.Address).Offset(0, 1) = hLink.Hyperlinks(1).Address
Next
End Sub
Save your excel file[in excel 2007 and above save as macro enabled...]