Hyperlink help

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have created some hyperlinks within a spreadsheet so that when one is clicked it activates the sheet the link is refering to. What I would now like to do is that when this hyperlink (and subsequently the sheet) is selected, I want it to automatically run a marco.
Is this possible?
 
You may be able to use the worksheet_activate event--depending on your version
of excel.

In xl2002, I rightclicked on my "to" worksheet and selected view code.

I pasted this in the code window:

Option Explicit
Private Sub Worksheet_Activate()
MsgBox "hi"
End Sub


In xl2002, when the worksheet is activated (including via the link), this event
will fire.

IIRC, in xl2k, this event didn't fire when initiated via a hyperlink.

One way around it is to get rid of the hyperlinks and use code to do the
"movement".
 
instead of MsgBox "Hi" you would use simply
use the macro name in it's place. If that does not work
see http://www.mvps.org/dmcritchie/excel/install.htm#activate


Dave Peterson said:
You may be able to use the worksheet_activate event--depending on your version
of excel.

In xl2002, I rightclicked on my "to" worksheet and selected view code.

I pasted this in the code window:

Option Explicit
Private Sub Worksheet_Activate()
MsgBox "hi"
End Sub


In xl2002, when the worksheet is activated (including via the link), this event
will fire.

IIRC, in xl2k, this event didn't fire when initiated via a hyperlink.

One way around it is to get rid of the hyperlinks and use code to do the
"movement".
What I would now like to do is that when this hyperlink (and subsequently the sheet) is selected, I want it to automatically run a
marco.
 
How do you create a link that activates another sheet? I can only seem to
create one that references a particular cell. I want to create a menu on
sheet1 that links (using ActiveX buttons) into the other sheets. Any ideas?
 
Hi
use a reference like the following:
#Sheet2!A1

--
Regards
Frank Kabel
Frankfurt, Germany

Danielle said:
How do you create a link that activates another sheet? I can only seem to
create one that references a particular cell. I want to create a menu on
sheet1 that links (using ActiveX buttons) into the other sheets. Any ideas?
one is clicked it activates the sheet the link is refering to. What I
would now like to do is that when this hyperlink (and subsequently the
sheet) is selected, I want it to automatically run a marco.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top