Is this possible from combi box

  • Thread starter Thread starter Paul Watkins
  • Start date Start date
P

Paul Watkins

Hi
Using a drop-down box (Combi Box), i want to be able to select an item from
a list e.g 'Chocolate Bar' then in another combi box, display that item's
cost automatically.


------------------ -------------------------
Chocolate Bar £0.50
------------------ -------------------------


Thanks in advance


Paul
 
Paul,

If you have a couple of worksheet ranges, one with the items, a second with
the prices, you can load the items combobox from that first list and you can
use the Listindex property of the combobox to offset into the second range.
Also, why a combobox for the price, there will only be one item so why not
use textbox?

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Thanks Bob, i'll give it a try today.

Paul
Bob Phillips said:
Paul,

If you have a couple of worksheet ranges, one with the items, a second with
the prices, you can load the items combobox from that first list and you can
use the Listindex property of the combobox to offset into the second range.
Also, why a combobox for the price, there will only be one item so why not
use textbox?

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Post back if you need some help.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
I've set up a sheet with a range of items in A1:A40 and the costs in B1:B40.
I've inserted a combi box using the 'control toolbox' and have linked the
listfillrange to A1:A40, however I am having difficulty in finding the
'listindex' property of the combibox, to offset into the second range.how
can i access it?

Paul
 
Are you doing this in code:

Option Explicit
Private Sub ComboBox1_Change()
Me.ComboBox1.TopLeftCell.Offset(0, -1).Value _
= Me.Range("b1:b40")(Me.ComboBox1.ListIndex + 1)
End Sub

But you could just use a cell near the combobox and a linked cell (under
properties for the combobox from the control toolbox toolbar).

I used C1 as my linked cell:
=if(c1="","",vlookup(c1,a1:b40,2,false))
 
Thanks, that works perfectly

Paul

Dave Peterson said:
Are you doing this in code:

Option Explicit
Private Sub ComboBox1_Change()
Me.ComboBox1.TopLeftCell.Offset(0, -1).Value _
= Me.Range("b1:b40")(Me.ComboBox1.ListIndex + 1)
End Sub

But you could just use a cell near the combobox and a linked cell (under
properties for the combobox from the control toolbox toolbar).

I used C1 as my linked cell:
=if(c1="","",vlookup(c1,a1:b40,2,false))
 
Back
Top