Consulting

Results 1 to 5 of 5

Thread: Solved: Automate Listbox hyperlink

  1. #1
    VBAX Regular
    Joined
    Dec 2007
    Location
    Live in the state of Queensland in
    Posts
    11
    Location

    Talking Solved: Automate Listbox hyperlink

    hi folks
    Attached is my Demo test file.
    In Worksheet 1 you will see a dropdown picklist - it has been acheived by Using Data/Validation select list. However while it does work - to change the hyperlink what I would prefer it to do is as a user makes their choice/pick from the list they are taken straight away to the worksheet they have chosen -without the the need for the user to actually also have to click on the hyperlink then going to the worksheet. So what I am trying to achieve is one less interaction needed from the user.

    Also how can I get the text in the listbox dropdown to be a slightly bigger font size so ti is easier to read for the user.

    Thanks in advance

    Vikki_61

  2. #2
    Moderator VBAX Guru Simon Lloyd's Avatar
    Joined
    Sep 2005
    Location
    UK
    Posts
    3,003
    Location
    Try this in your worksheet change module, no need for hyperlinks it will work of the validated cell!
    [VBA]
    Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Cells.Count > 1 Then Exit Sub
    If Target.Address <> "$F$23" Then Exit Sub
    Select Case Target

    Case "Disney Land"
    Sheets(3).Activate
    Case "Pleasure Island"
    Sheets(4).Activate
    Case "Water World"
    Sheets(5).Activate
    Case "Fun Park"
    Sheets(6).Activate
    End Select

    End If

    End Sub
    [/VBA]
    Regards,
    Simon
    Please read this before cross posting!
    In the unlikely event you didn't get your answer here try Microsoft Office Discussion @ The Code Cage
    If I have seen further it is by standing on the shoulders of giants.
    Isaac Newton, Letter to Robert Hooke, February 5, 1675 English mathematician & physicist (1642 - 1727)

  3. #3
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    1.

    [vba]

    Private Sub Worksheet_Change(ByVal Target As Range)

    If Not Intersect(Target, Range("F23")) Is Nothing Then

    On Error Resume Next
    Target.Hyperlinks(1).Delete
    On Error GoTo 0

    Select Case Target

    Case "Disney Land": Application.Goto Worksheets("3. DISNEYLAND").Range("A1")

    Case "Pleasure Island": Application.Goto Worksheets("3. PLEASURE ISLAND").Range("A1")

    Case "Water World": Application.Goto Worksheets("4. WATER WORLD").Range("A1")

    Case "Fun Park": Application.Goto Worksheets("5. FUN PARK").Range("A1")
    End Select
    End If


    End Sub
    [/vba]

    2. See http://www.contextures.com/xlDataVal08.html#Font
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  4. #4
    VBAX Regular
    Joined
    Dec 2007
    Location
    Live in the state of Queensland in
    Posts
    11
    Location

    Talking

    Thankyou Simon Lloyd - I got a debug but fix it by removing the end if then it worked great.

    Thankyou again SIR XLD your code worked great first up...no Problems

    Regards
    Vikki_61

  5. #5
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    I am confused as tgo where this fits with the original question, they seem to be going in different directions.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

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