• Hyperlink autoexecute

    • This topic has 9 replies, 6 voices, and was last updated 10 years ago.
    Author
    Topic
    #499601

    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

    Viewing 3 reply threads
    Author
    Replies
    • #1500982

      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 FilesInternet ExplorerIExplore.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”),””)

    • #1501036

      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
      
      • #1501084

        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&quot;),"")

        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

        • #1501093

          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

          • #1501204

            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

            • #1501206

              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

    • #1501412

      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

    • #1501999
    Viewing 3 reply threads
    Reply To: Hyperlink autoexecute

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: