Validation Dropdowns - 2 columns?

darsha
NewLounger
Posts: 19
Joined: 15 Mar 2010, 11:56

Validation Dropdowns - 2 columns?

Post by darsha »

I need to prepare a xls 'template' for users to populate with data. Essentially, each sheet in the workbook will correspond to a table in a SQL Server database.
The data will imported into SQL server via a Visual Studio project.

In the database, a number of tables have columns containing ID values which link to other (lookup) tables.

If I define a 2 column dynamic range (not sure how to do do the dynamic bit) is there any way I can define data validation dropdowns to display the second column in the range (descriptive text) whilst storing the first column(integer value) in the cell?

User avatar
HansV
Administrator
Posts: 78548
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Validation Dropdowns - 2 columns?

Post by HansV »

You can do that kind of thing in Access, but not in Excel.

You could have the validation dropdown display (and store) the ID value, and use a lookup formula in the cell next to it to display the corresponding description, or the other way round.

If you want a dropdown with two columns, you'd have to use a combo box from the Control Toolbox (ActiveX controls), but that is not a very attractive solution.
Best wishes,
Hans

darsha
NewLounger
Posts: 19
Joined: 15 Mar 2010, 11:56

Re: Validation Dropdowns - 2 columns?

Post by darsha »

I though that might be the case :( thankyou