multiple lookups?

J

Jackson

I have a sheet wherein Column A contains list of Products and Column B contains it's price

Multiple products may have the same price

Elsewhere, if the user selects a particular price, is it possible to feature its corresponding products (by data validation drop down or any other way)
 
A

A.W.J. Ales

Jackson,

I don't know wether this will do for you, but from what I understand of your
posting I would use a filter on your range of products and prices.
(Select (a cell within) your datarange and then Data / Filter / Autofilter).
By filtering on the price you then get the records of all products with that
price.

--
Regards,
Auk Ales

* Please reply to this newsgroup only *
* I will not react on unsolicited e-mails *

Jackson said:
I have a sheet wherein Column A contains list of Products and Column B contains it's prices

Multiple products may have the same prices

Elsewhere, if the user selects a particular price, is it possible to
feature its corresponding products (by data validation drop down or any
other way)
 
J

Jackson

Hi! Thanx for the repl

This can more or less do the job but I still require the custom to be "equal" to a cell reference, say "C1
Can this be done?
 
A

A.W.J. Ales

Hi Jackson,

I don't understand fully what you say about the custom to be equal to a cell
reference, but getting back to your original posting I assume that you want
cell C1 (in your example) or a dropdown box in that cell to be "loaded"
with the products with the selected price.
That is possible, but requires a (Visual Basic) program.

1) Name the range (without the heading) where your products and prices are
stored Product_Price_Range
2) Name the cell where you input one of the prices ( to get a combobox of
product with that price) PriceSelected
3) From the ControlToolbox bar (NB NOT the Forms Toolbar) select a combobox
and place it on your sheet.
4) Rightclick the sheetname and select View Code. This takes you to the
Visual Basic Editor and to the "sheetmodule".
5) On that module place the following two subroutines :

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = Range("PriceSelected").Address Then
ComboBox1_GotFocus
ComboBox1.ListIndex = 0
End If
End Sub

Private Sub ComboBox1_GotFocus()
Dim ProductSel()
Rs = Range("Product_Price_Range").Rows.Count
Cols = Range("Product_Price_Range").Columns.Count
PriceSel = Range("PriceSelected").Value
ComboBox1.Clear
For I = 1 To Rs
If Range("Product_Price_Range")(I, 2).Value = PriceSel Then
Product = Range("Product_Price_Range")(I, 1).Value
ComboBox1.AddItem Product
End If
Next
End Sub


This all will set up your combobox with the products with the price you did
input in cell "PriceSelected".

To do something with that combobox however you will have to do some
additional programming.


--
Regards,
Auk Ales

* Please reply to this newsgroup only *
* I will not react on unsolicited e-mails *

Jackson said:
Hi! Thanx for the reply

This can more or less do the job but I still require the custom to be
"equal" to a cell reference, say "C1"
 
Top