Automating entry using validation

D

Dianna

I have two columns e.g. - fruit, code
apples, 01
oranges 02
lemons 03
On my form the cell for apples is a validation list cell
and I would like the cell for the code to appear in
another cell automatically.

I like validation rather than a drop-down combo box
because the "box" isn't seen until the cursor is in that
cell and doesn't print.

Can both cells be validation with the proper function in
the appropriate cell?
 
S

steve

Dianna,

You could put a formula into the code cell. Either an If..then..else
or a Vlookup (if there are a lot of "fruit")

In both cases use a multi-level If statement. For example - if the fruit is
in A1 and the code is in B1 and your table is in D1:E5

=If(A1, Vlookup(A1,D1:E5,2),"")

The "" will leave B1 blank if no choice is made.
Beware that no match will result in #NA. You can trap for this in your
formula, but since you are using a Validation list, it shouldn't be an
issue.
 

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

Top