ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   HyperLink function runs wild when unrelated column is filtered (https://www.excelbanter.com/excel-programming/409638-hyperlink-function-runs-wild-when-unrelated-column-filtered.html)

Bob Nyholm

HyperLink function runs wild when unrelated column is filtered
 
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


All times are GMT +1. The time now is 07:19 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com