You are here:

Excel/Questions and Answers in Pull-down menu format

Advertisement


Question
QUESTION: Dear Tom,

I have a list of questions and answers I would like to set up as a pull-down menu format.

What make of vehicle?
1)GM What model?
  a. Corvette
      i.What colour
         1.White
         2.Yellow
  b.Malibu
  c.Enclave
  
2)Ford
   a. Escape
   b. Explorer

3)Toyota
   a. Camry
   b. Avalon

How do I set up Excel so I can ask question #1) What make of vehicle? Then the options on the pull-down menu would be GM, Ford, Toyota.  After selecting GM, then the next question that will ask me is what model?  List of answers on pull-down menu would be Corvette, Malibu, and Enclave, and so on.

How would I set this up in Excel?

Thanks.

Michael

ANSWER: Michael,

This isn't a question that a few sentences would answer.  So let me refer you to a web page that gives detailed instructions.  This is Debra Dalgleish's site:

http://www.contextures.com/xlDataVal02.html
she also has an alternative approach on this page
http://www.contextures.com/xlDataVal15.html

You could also do a general google search such as this:
https://www.google.com/#q=excel+dependent+drop+down+list

and get a variety of explanations.  Some would be macro dependent and some, like Debra that offer non-macro solutions.

As I said, this isn't something that requires a short explanation, so I think referring you to a detailed explanation/solution that has been successfully employed my many many people is the best answer for you.   

If you have problems,  you can send me a sample workbook and a complete explanation of what you want and I will take a look.   twogilvy@msn.com

--
Regards,
Tom Ogilvy



---------- FOLLOW-UP ----------

QUESTION: Thanks Tom.  I did see that link.  I noticed these examples use single word or two word.  What if my questions are 10-15 words long. I don't this would work.

I'm thinking of using IF statements with combination of validation data but it's a bit of a pain to do.

Thanks.

Michael

ANSWER: Michael,

as you appear to be aware, a named range can not have spaces in it - thus your concern about a two word choice as an example.  The way I do that is

Choice   Big Dog
In Cell A1
Named range for Big Dog:  Big_Dog

=Indirect(Substitute(A1," ","_"))

so  Substitute(A1," ","_")  turns Big Dog into Big_Dog and then feeds it to Indirect.

--
Regards,
Tom Ogilvy


---------- FOLLOW-UP ----------

QUESTION: Thanks Tom.

If I have a few cells that have pull-down menus created (i.e. using validation for list), is there a way to clear all these cells to to blank cells automatically by creating a shortcut rather than having to go into each cell and pressing Delete.

Thanks.

Michael

Answer
Michael,

you would need to create a macro such as

Sub ClearCells()
 Worksheets("Data").Range("A1,B9,C11,A6").ClearContents
End Sub

and assign that a shortcut key combination.  This code should be placed in a general module.

and alternate approach (more manual in nature) would be to create a named range


Name:  Dropdowns
Refersto:  =Data!$A$1,Data!$B$9,Data!$C$11,Data!$A$6

Then whenever you want to clear the dropdowns, you would select that name from the name box and all those cells would be select.  You could then clear the cells all at once.

--
Regards,
Tom Ogilvy

About Excel
This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here

Excel

All Answers


Answers by Expert:


Ask Experts

Volunteer


Tom Ogilvy

Expertise

Selected as an Excel MVP by Microsoft since 1999. Answering Excel questions in Allexperts since its inception in 2001. Able to answer questions on almost all aspects of Excel's internal capabilities. If seeking a VBA solution, please specify that in your question itself so I give you the answer you want. [Excel has weak protection - if you are distributing an application, I don't answer questions on how to protect your project from your users.]

Experience

Extensive experience.

Education/Credentials
Master of Science (MS) degree Operations Research (ORSA)

Awards and Honors
Microsoft MVP in Excel.

©2016 About.com. All rights reserved.