Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Value in cell based on another cell, used in combo box Excel 1

Status
Not open for further replies.

SteveNapper

Technical User
Aug 29, 2002
39
GB
Sorry for the complex subject, but wanted to make it as easy as possible for you all!

I have spreadsheet with 2 tabs. One tab contains a regular sheet, with combo boxes for a pick list in place of one column listing products. I need col B & C to display the cost/unit and weight/unit.

The combo box, and the data for col B & C will come from the second tab, and be listed in cols A, B & C respectively.

EG
I want to look up product 5 using a combo box located at A1, and B1 to display the weight/unit, and C1 to display the cost/unit
A2 to display product 2, B2, etc., etc.

I'm sure that the answer is very simple, but I have NO IDEA about VBA, so please explain it simply, or point me in the right direction for some intro stuff.

Many thanks
 
I suggest you pick up an Excel programming book (an entry-level book will work just fine - my first one was Excel 2000 programming for dummies) and get the hang of things. This is not to say this forum doesn't provide help for simple tasks, but often I think people come here with a problem and keep coming back for the next simple step, never actually learning how to accomplish things themselves. A good foundation is worth a lot.

Rob
[flowerface]
 
No code needed at all:
You can use Data Validation for your drop down box
Name the contents of ColA in your 2nd sheet something like "Products"
Name contents of Col A to C "Data"
Then, select the cells you want to assign the drop downs to and go Data>Validation
Choose "List" and in the textbox enter =Products
in B1 enter
=if(A1="","",vlookup(A1,Data,2,false))
in C1 enter
=if(A1="","",vlookup(A1,Data,3,false))
copy these down as far as you want

Should do the trick
Rgds
~Geoff~
 
Many thanks Geoff, dug me out of a hole and taught me something I didn't know.

Steve
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top