FollowHyperlink事件不起作用 [英] FollowHyperlink event not working

查看:197
本文介绍了FollowHyperlink事件不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我将其与超链接功能一起使用时,FollowHyperlink事件未触发:

FollowHyperlink event not FIRE when I use it with hyperlink function :

=IF(C8505=0;IF(F8505=0;"";IF(H8505=0;"Nothing";IF(G8505="Memo";HYPERLINK("\\scan2014\memo\"&H8505&".pdf";" Link ");HYPERLINK("\\scan2014\"&H8505&".pdf";"Link"))));IF(H8505=0;VLOOKUP("*"&Inbox!$C8505&"*";Sheet1!A:C;1;FALSE);IF(G8505="Memo";HYPERLINK("\\scan2014\memo\"&H8505&".pdf";VLOOKUP("*"&Inbox!$C8505&"*";Sheet1!A:C;1;FALSE));HYPERLINK("\\scan2014\"&H8505&".pdf";VLOOKUP("*"&Inbox!$C8505&"*";Sheet1!A:C;1;FALSE)))))

我要触发的代码是:

Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
LastR = Sheets("Track").Range("a10000").End(xlUp).Row + 1

With Worksheets("Track")
.Hyperlinks.Add Anchor:=Sheets("Track").Range("a" & LastR), _
Address:="", _
SubAddress:="inbox!" & Target.Parent.Address, _
ScreenTip:=Target.Parent.Address
End With

 End Sub

推荐答案

这是设计使然. HYPERLINK()函数不会引发事件,插入超链接会引发事件.如果您需要引发该事件,请修改公式以跳至工作表中的 transfer 单元格,例如Z100.

This is by design. The HYPERLINK() function does not raise the event, Inserted hyperlinks do raise the event. If you need the event to be raised, modify your formula to jump to a transfer cell in the worksheet, like Z100.

在Z100中,放置一个插入超链接以到达最终目的地.

In Z100 place an Inserted hyperlink to get to the final destination.

通过这种方式可以同时获得公式的灵活性和宏功能.

This way to get the flexibility of a formula and the macro capability at the same time.

这篇关于FollowHyperlink事件不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆