question on vlookup

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am setting up a Quality Check sheet for various suppliers.
The sheet contains various information related to various products.
Each product is made by different suppliers.
I want to use VLOOKUP to get data related to particular product.
I have sheets with details for each supplier.
I would like to know how can i change the range in each vlookup function so
that, once i select a particular supplier on my quality check sheet, for each
detail required on that page, the vlookup function selects the range for that
selected supplier automatically.
Meaning once i select the supplier the variuos vlookup on the main sheet
select the data only from the range of the selected supplier.
Is there anyother way to do it.
Please help
 
Set up your Vlookup to use a range variable as the 2nd argument. When you
select a supplier, set that variable to the corresponding range. Then do
your lookup.

General outline:
******
Dim SupplierInfoRange as Range

Select Case SupplierSelection
Case "Supplier Able"
Set SupplierInfoRange = range_containing_SupplierAble_info
Case "Supplier Baker"
Set SupplierInfoRange = range_for_SupplierBaker
' ... yada, yada
End Select

MyResult = Vlookup(item_detail_to_look_for, SupplierInfoRange,
column_number_to_return, T_or_F)
**********
HTH,
 

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

Back
Top