Publish table to SharePoint with Hyperlink formula

Sevententh

New Member
Joined
Nov 24, 2011
Messages
2
Hi all,

I have a table that has 1 column as a hyperlink formula (based on values in other columns) The problem is when I publish this to SharePoint the hyperlinks are removed and all I get is the value.

So I thought that it might be possible to do this in VBA, and have the sheet automatically insert the hyperlink into a column... Would this work?

I basically have columns: Manufacture | Part No | FileName | Hyperlink

The hyperlink formula for the column is:
+HYPERLINK("https://webaddress/Shared%20Documents" &"/" & [MANUFACTURER] &"/" & [PART No] & "/" & [Filename], LEFT([Filename], LEN([Filename])-4))

Result looks like this:
https://webaddress/Shared Documents/Company/x123x/Document.pdf, Document
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Figured it out and this works!

Code:
Sub Hyper()
Dim i, j As Integer
Dim k, strPartNumber, strManufacturer As String

Dim RemoteWeb, strBuild, FriendlyName As String

i = Cells(Rows.Count, 2).End(xlUp).Row
Range("N3").Select

    RemoteWeb = "https://website/Shared%20Documents/"

Do
    j = ActiveCell.Row
    ActiveCell.ClearContents
    
    strManufacturer = Cells(j, 6).Value 'Manufacturer
    strPartNumber = Cells(j, 7).Value 'Part No
    
    'Datasheet hyperlink
    strBuild = strManufacturer & "/" & strPartNumber & "/" & Cells(j, 13).Value
    FriendlyName = Left(Cells(j, 13).Value, Len(Cells(j, 13).Value) - 4)
    ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:=RemoteWeb & strBuild, TextToDisplay:=FriendlyName

    ActiveCell.Offset(1, 0).Select
    
    Loop Until ActiveCell.Row > i

End Sub
 
Upvote 0

Forum statistics

Threads
1,215,444
Messages
6,124,893
Members
449,194
Latest member
JayEggleton

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