Consulting

Results 1 to 3 of 3

Thread: Are multiple hyperlinks to run multiple macros within a single sheet possible?

  1. #1
    VBAX Regular
    Joined
    Aug 2006
    Posts
    82
    Location

    Are multiple hyperlinks to run multiple macros within a single sheet possible?

    I have a need to insert several hyperlinks into a worksheet, each that would run different macros. There is currently a single hyperlink running one macro, but I need at least one more. The code I have is...

    Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
    frmWIP.Show
    End Sub

    ...which runs my userform. I'm now building a second userform and need a second hyperlink to run it. I've tried referencing the hyperlink's cell, but then nothing happens at all.

    I'm kind of stuck. How can I make this work?

  2. #2
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
    
    Select Case Target.TextToDisplay
    Case "Work In Progress": frmWIP.Show
    Case "New Project": frmNewPrjct.Show
    End Select
    End Sub
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  3. #3
    VBAX Regular
    Joined
    Aug 2006
    Posts
    82
    Location
    That's what I was looking for, SamT! Thanks so much; I'm in business!

Posting Permissions

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