将 Excel UDF 获取到 Return 超链接
Getting an Excel UDF to Return a Hyperlink
目前要获得 UDF 到 return hyperlink 我使用类似的东西:
Public Function HyperActive() As String
HyperActive = "http://www.cnn.com"
End Function
在工作表单元格中,我使用:
=HYPERLINK(hyperactive(),"news")
做个好人,"click-able" link.
我想要 UDF return a "click-able" link 直接。我试过:
Public Function HyperActive() As Hyperlink
Dim h As Hyperlink
h.Address = "http://www.cnn.com"
Set HyperActive = h
End Function
只有 returns #VALUE! 在单元格中!如何让它工作?
喜欢将超链接添加到作品sheet中。如果您愿意,可以将它们添加到范围二。此功能将只添加该站点,您可以随时充实它以获取更多您喜欢的参数。
它将超链接添加到当前选定的单元格。尽管您也可以将其更改为您喜欢的任何内容。
Public Function HyperActive(ByRef rng As Range)
With ActiveSheet.Hyperlinks
.Add Anchor:=rng, _
Address:="http://www.cnn.com", _
ScreenTip:="Click to go to the Cnn Website", _
TextToDisplay:="CNN Website"
End With
End Function
Sub Calling_The_Hyper_link()
Call HyperActive(Selection)
End Sub
如果你添加 Public 函数 HyperActive(byref sh as worksheet, ByRef rng As Range)
你可以控制它进入哪个 sheet。
目前要获得 UDF 到 return hyperlink 我使用类似的东西:
Public Function HyperActive() As String
HyperActive = "http://www.cnn.com"
End Function
在工作表单元格中,我使用:
=HYPERLINK(hyperactive(),"news")
做个好人,"click-able" link.
我想要 UDF return a "click-able" link 直接。我试过:
Public Function HyperActive() As Hyperlink
Dim h As Hyperlink
h.Address = "http://www.cnn.com"
Set HyperActive = h
End Function
只有 returns #VALUE! 在单元格中!如何让它工作?
喜欢将超链接添加到作品sheet中。如果您愿意,可以将它们添加到范围二。此功能将只添加该站点,您可以随时充实它以获取更多您喜欢的参数。
它将超链接添加到当前选定的单元格。尽管您也可以将其更改为您喜欢的任何内容。
Public Function HyperActive(ByRef rng As Range)
With ActiveSheet.Hyperlinks
.Add Anchor:=rng, _
Address:="http://www.cnn.com", _
ScreenTip:="Click to go to the Cnn Website", _
TextToDisplay:="CNN Website"
End With
End Function
Sub Calling_The_Hyper_link()
Call HyperActive(Selection)
End Sub
如果你添加 Public 函数 HyperActive(byref sh as worksheet, ByRef rng As Range)
你可以控制它进入哪个 sheet。