HyperLink function runs wild when unrelated column is filtered

B

Bob Nyholm

I have a spreadsheet with a column of ~500 hyperlinks that were
created by the user defined function code below (only the real meat
shown). Workbook auto-calculation is turned ON to ensure hyperlinks
are updated when data is changed. If an unrelated column is filtered,
the spreadsheet goes into a never-ending recalculation mode.

Unrelated, Cells(jRow, jCol).Hyperlinks.Delete corrupt cell formatting

Is Application.Volatile or something similar needed?

Any help is appreciated.

Thanks.........bob

Function HyperLinkIt(Doc As String, DocType As String)
'
Dim jCaller As String
Dim jDoc As String
Dim jType As String
'
jCaller = Application.Caller.Address
'
jRow = Range(jCaller).Row
jCol = Range(jCaller).Column
'
jDoc = UCase(Doc)
jType = UCase(DocType)
'
HyperLinkIt = "*" '"select" 'jDoc
'
Cells(jRow, jCol).Hyperlinks.Delete 'For some reason this hurts
cell formatting if a hyperlink existed
'
jLink = "https://ecms.llnl.gov/ematrix/emxLogin.jsp?
mode=llnlPdfView&type=" & jType & "&name=" & jDoc
'
ActiveSheet.Hyperlinks.Add Anchor:=Cells(iRow, iCol),
Address:=jLink, TextToDisplay:=jDoc
'
End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top