Excel 2007:  Hyperlinks

Posted on 2011-04-19
Last Modified: 2012-08-14
Hello Experts,

    I'm curious, is it possible to hyperlink the contents of a cell to open up two different URL's when clicked on?  I have a topic I'm using and have created a hyperlink from that topic but there are several good references I'd like to point it to.  

    In a perfect world, my reader could just click on the topic hyperlink and multiple tabs would open showing it's reference URL's.  Is this possible in Excel?
Question by:itsmevic
    LVL 24

    Expert Comment

    I don't think so. You could link to another location with further links in separate cells perhaps?
    LVL 33

    Accepted Solution

    You can simulate this with the following code.

    Take a look at the sample attached file. Click on cell A1 and it will open 2 tab on your browser.

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
        If Target.Address = "$A$1" Then
            ActiveWorkbook.FollowHyperlink Address:="", NewWindow:=True
            ActiveWorkbook.FollowHyperlink Address:="", NewWindow:=True
        End If
    End Sub

    Open in new window


    Author Comment

    Very cool jppinto!  Thank you!  I'm wondering, could one perhaps expend that to say open three or even four by just adding additional  "ActiveWorkbook.FollowHaperlink...."  lines?  Not that it's a big deal as two is more than sufficient just curious.  Awesome input thank you again!  
    LVL 33

    Expert Comment

    Yes, just add additional lines to your code and it will open additional tabs on your browser.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Suggested Solutions

    A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
    Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
    This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
    This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now