Results 1 to 4 of 4
  1. #1
    New Lounger
    Join Date
    May 2003
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Worksheet Events (Excel 97)

    Hi All,

    I have a workbook with about 10 worksheets in it. The front worksheet is like a title page and has hyperlinks to the other sheets, but obviously users can also click on the tabs at the bottom of the sheets to access them.
    I want to trigger a macro to run whenever someone activates a sheet via either method. I know there is the following:

    Worksheet_Activate() event

    and also

    Worksheet_FollowHyperlink(ByVal Target As Hyperlink)

    but I only seem to be able to get one or other to run - I need to run the code on both events.

    Any suggestions?

    Thanks

    Cunners

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Worksheet Events (Excel 97)

    You must put the code for Worksheet_Activate in module of the target (destination) worksheet, and the code for Worksheet_FollowHyperlink in the source worksheet. They should both work then - they do so in Excel 2002, I can't test on Excel 97.

  3. #3
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Worksheet Events (Excel 97)

    Instead of having the code in these 2 event procedures, Have the routine (for both) created in a regular module.

    Have both routines call the routine.

    Steve

  4. #4
    New Lounger
    Join Date
    May 2003
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Worksheet Events (Excel 97)

    Hi guys,

    I've tried both and I don't seem to be able to get the hyperlink event to work in the main sheet. Could be a quirk of Excel 97 ?

    Just trying to get it to work as a seperate procedure.

    Thanks,

    Cunners

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •