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
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » Hyperlink autoexecute
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”),””)
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
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
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
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
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
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
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
It seems the OP is still not content: http://www.mrexcel.com/forum/excel-questions/851429-excel-hyperlink-%3Dif-formula-excel-7-a.html
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.
Notifications