Results 1 to 10 of 10
  1. #1
    Star Lounger
    Join Date
    Feb 2009
    Location
    Evanston, Illinois, USA
    Posts
    85
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Hyperlink autoexecute

    How can I Autoexecute a hyperlink using a true or false condition in the excel =IF(
    formula ??

    I have excel 7 running under vista

    Thanks for any step by step help ... Theodore

  2. #2
    Lounger
    Join Date
    Feb 2011
    Posts
    28
    Thanks
    0
    Thanked 10 Times in 8 Posts
    I adapted the script I found here like this:

    Function LaunchIE(strURL As String)
    Dim shell
    Set shell = CreateObject("WScript.Shell")
    shell.Run """C:\Program Files\Internet Explorer\IExplore.exe""" & strURL & ""
    Set shell = Nothing
    End Function

    Then in your cell, have an IF statement along the lines of
    =IF(condition,LaunchIE("https://www.google.com"),"")

  3. #3
    Gold Lounger Maudibe's Avatar
    Join Date
    Aug 2010
    Location
    Pa, USA
    Posts
    2,631
    Thanks
    115
    Thanked 645 Times in 589 Posts
    Theodore,

    Here is another approach. in cell B1, there is a hyperlink to google. Cell C1 has a hyperlink to Microsoft. If the user enters a 1 in cell A1, the hyperlink is fired from B1. If the user enters a zero, the hyperlink in C1 is fired instead. Any other value has no event.

    HTH,
    Maud

    Code:
    Private Sub Worksheet_Change(ByVal Target As Range)
     If Target.Cells.Count > 1 Then Exit Sub
        If Not Intersect(Target, Range("A1")) Is Nothing Then
            Select Case Target
            Case 1
                Range("B1").Hyperlinks(1).Follow
            Case 0
                Range("C1").Hyperlinks(1).Follow
            End Select
        End If
    End Sub
    Attached Files Attached Files

  4. #4
    Star Lounger
    Join Date
    Feb 2009
    Location
    Evanston, Illinois, USA
    Posts
    85
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hello VIP:

    I don't know the script you are using. But here is my good working =IF( formula:

    =IF(A20<10,HYPERLINK("http://www.Higginsparts.com"),"")

    A20 is where a numeric quantity is stored. Once it reaches 9 or below then a parts distributor' website is automatically displayed. The key word is an automatic execution (without clicking on the website URL).

    Thanks for any help ... Theodore

  5. #5
    WS Lounge VIP
    Join Date
    Mar 2002
    Location
    Newcazzle, UK
    Posts
    2,820
    Thanks
    133
    Thanked 481 Times in 458 Posts
    Hi Theodore

    unclehewie in post#2 showed how to do this with a custom function.
    Maud showed another way.

    But perhaps an example would make it clear.
    See attached file.
    (This assumes you are using Internet Explorer as your browser)

    When the value in cell [A20] reaches a trigger level (either by a formula, or by directly entering a value), the formula with the function will then operate.

    zeddy
    Attached Files Attached Files

  6. #6
    Star Lounger
    Join Date
    Feb 2009
    Location
    Evanston, Illinois, USA
    Posts
    85
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi Zeddy:

    Your =IF formula works very well under IE or Firefox and displays the correct URL.The computer user then has to click on the URL and the website appears.

    However it does not automatically open up the website. It still needs a left click. My company sometimes has remote sales after 5:00 PM and there is no employee there to look at and check a computer monitor.

    I wonder if the =IF formula has a autoexecute switch which needs no human intervention ??

    Any ideas ... Theodore

  7. #7
    WS Lounge VIP
    Join Date
    Mar 2002
    Location
    Newcazzle, UK
    Posts
    2,820
    Thanks
    133
    Thanked 481 Times in 458 Posts
    Hi Theodore

    ..on my system, you don't need to click the URL.
    The URL's could be defined elsewhere e.g in hidden columns, or in 'named' cells.
    It is the 'result' of the formula cell (which incorporates the custom function) which triggers the display of the relevant website.
    As soon as the trigger value changes in the relevant cell, the website opens up automatically on my system.

    zeddy
    Last edited by zeddy; 2015-04-23 at 14:46.

  8. #8
    Gold Lounger Maudibe's Avatar
    Join Date
    Aug 2010
    Location
    Pa, USA
    Posts
    2,631
    Thanks
    115
    Thanked 645 Times in 589 Posts
    Theodore,

    Here is some code that when you enter a value in A20 that is less than 10, your browser will immediately surf to the site. In my sample, I have pointed to google since the url you provided does not seem to be a valid one.

    HTH,
    Maud
    Attached Files Attached Files

  9. #9
    3 Star Lounger Supershoe's Avatar
    Join Date
    Apr 2014
    Location
    Austin, TX
    Posts
    252
    Thanks
    1
    Thanked 36 Times in 34 Posts
    Here is part of a double_click event to goto yahoo finance for the symbol clicked.

    ActiveWorkbook.FollowHyperlink Address:= _
    "http://finance.yahoo.com/q?s=" & Target.Value
    Don Guillett
    Excel Developer
    dguillett @gmail.com

  10. #10
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts
    It seems the OP is still not content: http://www.mrexcel.com/forum/excel-q...excel-7-a.html
    Regards,
    Rory

    Microsoft MVP - Excel

Posting Permissions

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