Is this possible from combi box

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
 
B

Bob Phillips

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)
 
P

Paul Watkins

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)
 
B

Bob Phillips

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)
 
P

Paul Watkins

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
 
D

Dave Peterson

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))
 
P

Paul Watkins

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))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top