Results 1 to 2 of 2

Adding more parameters to decide hyperlink address

Threaded View

  1. #1
    Registered User
    Join Date
    01-27-2008
    Posts
    8

    Adding more parameters to decide hyperlink address

    Hi, i've tried adding to code to make a single hyperlink have multiple, or in this case more than 2 addresses. If you open the attached sheet and look in the vba editor you'll see how the code looks at the moment. My question is how do i add to it so that the hyperlink will have more than 2 possible pathways.

    Many thanks in advance.

    Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Address = "$C$3" Then
        Application.EnableEvents = False
        For N = 1 To Range("E6").Hyperlinks.Count
            Range("E6").Hyperlinks(1).Delete
            Range("E6").ClearContents
        Next N
        If IsNumeric(Target.Value) And Target <> "" Then
            Select Case Target.Value
                Case Is > 0.25
                    ActiveSheet.Hyperlinks.Add Anchor:=Range("E6"), Address:="", SubAddress:= _
                    "Sheet3!A1", TextToDisplay:="Sheet3!A1"
                Case Is <= 0.25
                    ActiveSheet.Hyperlinks.Add Anchor:=Range("E6"), Address:="", SubAddress:= _
                    "Sheet2!A1", TextToDisplay:="Sheet2!A1"
            End Select
            
        End If
        Application.EnableEvents = True
    End If
    End Sub
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1