View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Non VB (simple VB) Hyperlink Data Validation List

I'd use data|validation to create the dropdown. (I used A1 for my sample.)

I'd put the friendly names in column A of Sheet2 and the actual URLs in column B
of sheet2. And give that range in column A a nice name (to be used with
data|validation).

http://contextures.com/xlDataVal01.html#Name
(from Debra Dalgleish's site)

Then I'd plop a button from the Forms toolbar near that cell with the data
validation.

I'd assign this macro to the button.

Option Explicit
Sub testme()

Dim myCell As Range
Dim myRng As Range
Dim res As Variant

Set myCell = ActiveSheet.Range("a1")

If IsEmpty(myCell.Value) Then
Beep
Exit Sub
End If

Set myRng = Worksheets("sheet2").Range("a:a")

res = Application.Match(myCell, myRng, 0)

If IsError(res) Then
MsgBox "Design error!"
Else
ThisWorkbook.FollowHyperlink myRng(res).Offset(0, 1)
End If

End Sub

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm



"ric.todd" wrote:

Can't get this figured out.

Need to make a list of hyperlinks drop down that is populated from a
separate wsheet. The real catch is I need to use simple titles for long
hyperlinks (ie. google for http://www.google.com) simialr to a an html
dropdown menu.

I am very new to this so go easy on me, please.

Thanks in advance,

rt


--

Dave Peterson