You can do it with some programming. Drop a Combobox from the
Controls command bar onto Sheet1. Then, open VBA. Insert a new module
and paste in the following code:
Sub InitCBoxLinks()
Dim Arr(1 To 4, 1 To 2)
Sheet1.bInSetup = True
Application.EnableEvents = False
Arr(1, 1) = "Google"
Arr(1, 2) = "
http://www.google.com"
Arr(2, 1) = "Yahoo"
Arr(2, 2) = "
http://www.yahoo.com"
Arr(3, 1) = "Bing"
Arr(3, 2) = "
http://www.bing.com"
Arr(4, 1) = "Pearson"
Arr(4, 2) = "
http://www.cpearson.com"
With Sheet1.ComboBox1
.Clear
.ColumnCount = 2
.Width = 200
.ColumnWidths = "190;0"
.Style = fmStyleDropDownList
.List = Arr
.ListIndex = 0
End With
Application.EnableEvents = True
Sheet1.bInSetup = False
End Sub
Change the values assigned to Arr to meet your needs. The array has 4
pairs of values. You can increase this to as many element pairs as
you need. The first element of each pair is the text that will be
displayed in the combobox's dropdown. The second element of each pair
is the URL to which you want to navigate. The second element, the
URL, is not visible in the combobox. Only the first element is
visible.
Next, you need code in the Sheet1 module to handle the events of the
combobox. In the Sheet1 module, paste:
Public bInSetup As Boolean
Private Sub ComboBox1_Change()
Dim URL As String
If Me.bInSetup = True Then
Exit Sub
End If
With Me.ComboBox1
If .ListIndex < 0 Then
Exit Sub
End If
URL = .List(.ListIndex, 1)
End With
ThisWorkbook.FollowHyperlink URL
End Sub
Now, whenever the user changes the value of the combobox, Windows will
navigate IE to the web site associated with the selected value.
Cordially,
Chip Pearson
Microsoft MVP 1998 - 2010
Pearson Software Consulting, LLCwww.cpearson.com
[email on web site]
Is there a way to embed hyperlinks in either:-
a) dropdown lists
b) combo boxes
c) data validation boxes.
In my worksheet, I want to permit users to hyperlink out from these
functions based on their selection.
Please help. Thank you.