View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
dan dungan dan dungan is offline
external usenet poster
 
Posts: 411
Default drop down list for IF equation

Hi Steve,

I'm still not clear about your needs, but maybe this from the archives
in 2004 will give you some ideas:

3. Vic Eldridge
Newsgroups: microsoft.public.excel.programming
From: (Vic Eldridge)
Date: 16 May 2004 21:14:50 -0700
Local: Sun, May 16 2004 8:14 pm

Hi Abhinav,

Try running the InsertCombos macro I've made for you. As it creates
the comboboxes, it uses the contents of cells A1:A5 (on Sheet2) to
define the list for the comboboxes. If you needed a different list
for each Combobox, post back with more details. Make sure the
ShowWebPage macro is in a standard module, it will be run whenever
you make a selection from one of the ComboBoxes.

Regards,
Vic Eldridge

Sub InsertCombos()
Dim cel As Range
For Each cel In Range("A1", Range("A65536").End(xlUp))
If cel.Value < "" Then
With ActiveSheet.DropDowns.Add( _
Left:=cel.Offset(0, 1).Left, _
Top:=cel.Top, _
Height:=cel.Height, _
Width:=80)
.ListFillRange = "Sheet2!$A$1:$A$5"
.OnAction = "ShowWebPage"
End With
End If
Next cel
End Sub

Sub ShowWebPage()
With ActiveSheet.DropDowns(Application.Caller)
ActiveWorkbook.FollowHyperlink Address:= _
"http://www.example.com/" & .List(.ListIndex)
End With
End Sub