Click on a hyperlink to execute a VBA macro. How to setup the Macro
address and/or subadress fields for this? I remember seeing something
for this a while back.
Click on a hyperlink to execute a VBA macro. How to setup the Macro
address and/or subadress fields for this? I remember seeing something
for this a while back.
You could use the Worksheet_FollowHyperlink() event as below. This runs the
Sun RunCode in a standard module. Obviously you can test the values provided
by the Hyperlink object (Target) if you only want to react to certain
hyperlinks, etc.
Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
RunCode
End Sub
--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
nick_hodgeTAKETHISOUT@zen.co.uk.ANDTHIS
<alok.bisani@gmail.com> wrote in message
news:1115411486.112927.112750@o13g2000cwo.googlegroups.com...
> Click on a hyperlink to execute a VBA macro. How to setup the Macro
> address and/or subadress fields for this? I remember seeing something
> for this a while back.
>
Yes this would work. For eg. setup hyperlink with target address as the
hyperlink object range itself, and then intercept in follow event to
interpret Target range to action some sub routine. But this would mean
that everywhere you create hyperlink you will have to add its address
in the Follow event handler to switch control to a required sub
routine..
I think there might have been another way which I have seen
some time back. It was used to setup a hyperlink to run a macro in
another workbook using some formatting in the address and or
subadress(??). I have read recently that hyperlink to launch VBE code
for named sub routine is available <a
href="http://google.com/groups?as_umsgid=OD4%24vPeRCHA.1676@tkmsftngp12">
here->http://google.com/groups?as_umsgid=O...76@tkmsftngp12
</a>.
Now was there anything to execute a macro instead of editing it?
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks