View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Steve Steve is offline
external usenet poster
 
Posts: 1,814
Default drop down list for IF equation

Morning Dan,
Ok, I found the original post that Vic was responding to.
It appears his post was putting a combobox in one column, at the top, based
on the values of the previous column in that worksheet.
My goal is to place a single combobox- regardless of the prior column's
values.
My secondary goal is to have that combobox insert a name into an if
equation- in that cell.
My tertiary goal is to be able to drag that finished equation, with the name
selected by the combobox selection, all the way down to the bottom of my
dataset.

E.g. =if(A4="combobox_Name","B","C")
where combobox_Name" is the value I select from the combobox.

Thus, I'm trying to learn if I can place a combobox_Value to be part of the
IF equation. And if so, how is it done.




"dan dungan" wrote:

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


.