我已經看到了如何編輯超鏈接 - 但我需要一個自定義公式中使用時添加一個超鏈接。在VBA UDF添加超鏈接
我得到一個#VALUE錯誤,我不知道爲什麼。有沒有人有,爲什麼我得到一個#VALUE錯誤的任何想法,當我嘗試使用它在一張紙上=testit39()
Public Function testit39() As String
Application.Volatile
Dim rng As range, milestoneinfo As String, milestonesymbol As String
Set rng = Application.Caller
milestoneinfo = "info"
milestonesymbol = "symbol"
If rng.Hyperlinks.Count > 0 Then
rng.Hyperlinks(1).address = ""
rng.Hyperlinks(1).screentip = milestoneinfo
Else
ThisWorkbook.ActiveSheet.Hyperlinks.Add Anchor:=rng, _
address:="", _
screentip:=milestoneinfo
rng.Hyperlinks(1).screentip = milestoneinfo
End If
testit39 = milestonesymbol
End Function
它實際上可能但需要複雜的解決方法。 http://stackoverflow.com/questions/8520732/i-dont-want-my-excel-add-in-to-return-an-array-instead-i-need-a-udf-to-change – brettdj
並不複雜如果您使用的超級鏈接功能.. http://optionexplicitvba.blogspot.co.uk/2011/04/rollover-b8-ov1.html – Wickey312