How to create an error message

S

Siberian

I've created a drop-down menu. To the right of this menu are five cells
in a row in which data should be entered. But, data is not needed in
all five cells. Which cells need data depends on what choice is made in
the drop-down menu. Was that clear enough...?

If someone can give me a hint as to how I can make an error message
appear if data is entered in a cell which is not relevant to that
particular menu choice, I'd really appreciate it!
 
N

Nick Hodge

Siberian

Here's how I would go about it...

I would set up a data validation drop-down (let's say A1). In A1 go to
Data>Validation... and select 'List', in the text box enter your 3 choices,
separated by commas. (I am using Test1,Test2,Test3). Now in B1 take the same
menu options (We'll say you can enter data in this cell if Test1 is selected
in A1). Use 'Custom' this time and in the 'formula' box enter

=IF(A1="Test1",TRUE,FALSE)

And set an error message as necessary. Repeat for the remaining cells.

If you have more than one entry that can be made as an OR function

=IF(OR(A1="Test1",A1="Test2"),TRUE,FALSE)

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
www.nickhodge.co.uk
[email protected]
 
Top