+ Reply to Thread
Results 1 to 20 of 20

first option in a drop down menu

  1. #1
    Registered User
    Join Date
    11-12-2013
    Location
    ILLINOIS
    MS-Off Ver
    Excel 2010
    Posts
    21

    first option in a drop down menu

    Is there anyway that your drop down menu will automatically display the first option instead of a blank space?

    IE: a1 is a dropdown list of 1-10. When I first create the list it shows the blank.. is there any way to automatically change it to 1.

    I am asking because I am working with the indirect function. When my first drop down list is changed I want the second drop down box to automatically change to the first item on the drop down list. Is this possible?

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: first option in a drop down menu

    Where's the blank space coming from?

    If there is an entry in cell A1 when you click the drop arrow the list will automatically go to the entry that's in cell A1.

    If cell A1 is empty when you click the drop arrow the list will be displayed starting from the first item on the list.

    If you're getting a blank space then there must be an empty cell in the source for the drop down list.

    Where is it? Is the source a dynamic range?
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Registered User
    Join Date
    11-12-2013
    Location
    ILLINOIS
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: first option in a drop down menu

    Maybe I wasnt being specific enough: heres a copy of an example and my exact question.

    Thanks for the help
    Attached Files Attached Files

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: first option in a drop down menu

    You could use a lookup function for the "alien value". However, a cell can not contain both a formula and a drop down list (for the "non-alien" values) at the same time.

    You could use an event macro to do it. However, I'm not much of a programmer so if you wanted to go that route then someone else will need to help you.

    Maybe use one set of cells for the lookup of "alien values" and use another set of cells for the "non-alien" drop down list.

  5. #5
    Registered User
    Join Date
    11-12-2013
    Location
    ILLINOIS
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: first option in a drop down menu

    Appreciate the help.
    Im not much of a programmer myself.. was an architecture student but am starting to get into more programming and engineering.

    I looked into the lookup function and it does just what I wanted, but like you said I still have a problem with the non-alien values. Hopefully someone with more programming skill sees this

    Is there any way to maybe use a check box. If my box is checked(true) then it would display the lookup function. It it is unchecked(false) it would display a drop down menu?

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: first option in a drop down menu

    Quote Originally Posted by dawidski View Post

    Is there any way to maybe use a check box. If my box is checked(true) then it would display the lookup function. It it is unchecked(false) it would display a drop down menu?
    That would still require programming.

  7. #7
    Forum Contributor
    Join Date
    03-21-2013
    Location
    Corvallis, OR
    MS-Off Ver
    Excel 2010
    Posts
    174

    Re: first option in a drop down menu

    If your intention is to change which formula is represented with programing through a vba change event, it's pretty straight forward. It can be done 1 of 2 ways. 1st, you can have the vba code actually write the formula as you intend it to be written, or 2nd, you can combine both of the formulas into an if statement that looks at a cell value and displays formula 1 vs formula 2 based on that cell value, which can be updated via the change event. The 2nd will be easier to code, the first will be less intrusive in your workbook and will make the accidental deletion or change of said formula have no affect on the result because it will just be re-written every time the code runs. I would recommend the first option, especially if the formula is relatively simple.
    If I helped, please click on Add Reputation.

  8. #8
    Forum Contributor
    Join Date
    03-21-2013
    Location
    Corvallis, OR
    MS-Off Ver
    Excel 2010
    Posts
    174

    Re: first option in a drop down menu

    Now that I actually looked at your workbook the scenario is a little different than I first thought. How are the sources for the drop down boxes defined? (I'm very unfamiliar with dropdown boxes...) Instead of having a static source, if it is possible for the source of the dorpdown box to reference a range of formulas, then I would use a range of formulas that changes the information available to the source based on the first drop down box value.

  9. #9
    Forum Contributor
    Join Date
    03-21-2013
    Location
    Corvallis, OR
    MS-Off Ver
    Excel 2010
    Posts
    174

    Re: first option in a drop down menu

    Try adding this to the worksheet code:
    Please Login or Register  to view this content.
    Right click on the sheet, choose "view code", then paste this code.

    This changes the options in the 2nd dropdown box, but for some reason not the others. Like I said, I don't know much about drop down boxes, so there is probably something about their current design/layout that I'm missing here that needs to be further addressed.
    Last edited by bmxfreedom; 11-13-2013 at 12:09 AM. Reason: woops, that wasn't code...

  10. #10
    Forum Contributor
    Join Date
    03-21-2013
    Location
    Corvallis, OR
    MS-Off Ver
    Excel 2010
    Posts
    174

    Re: first option in a drop down menu

    Sorry, I just realized that I pasted the formula, not the code in that last post. If you're having problems, that's why...

  11. #11
    Registered User
    Join Date
    11-12-2013
    Location
    ILLINOIS
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: first option in a drop down menu

    Wow. Amazing. Thats exactly what I was looking for.

  12. #12
    Forum Contributor
    Join Date
    03-21-2013
    Location
    Corvallis, OR
    MS-Off Ver
    Excel 2010
    Posts
    174

    Re: first option in a drop down menu

    Learning as I go here, but I just figured out why the 3rd and 4th dropdown boxes weren't responding to changes in cell B3. It's because their sources were =INDIRECT(C3) and =INDIRECT(D3) respectively (references to blank cells) instead of =INDIRECT($B$3).

  13. #13
    Registered User
    Join Date
    11-12-2013
    Location
    ILLINOIS
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: first option in a drop down menu

    Im interested in learning more about this so I can do it myself next time. Know of any good links?

  14. #14
    Forum Contributor
    Join Date
    03-21-2013
    Location
    Corvallis, OR
    MS-Off Ver
    Excel 2010
    Posts
    174

    Re: first option in a drop down menu

    I've almost exclusively learned what I need by searching this forum for my questions. It's been very helpful. http://www.ozgrid.com/ is another good one.

  15. #15
    Forum Contributor
    Join Date
    03-21-2013
    Location
    Corvallis, OR
    MS-Off Ver
    Excel 2010
    Posts
    174

    Re: first option in a drop down menu

    If you need to know how to change those sources, it's done by selecting the cell with the dropdown box, then through the Data menu, choose Data Validation, then Data Validation again, then the source is very obvious.

  16. #16
    Forum Contributor
    Join Date
    03-21-2013
    Location
    Corvallis, OR
    MS-Off Ver
    Excel 2010
    Posts
    174

    Re: first option in a drop down menu

    Also, if you want 10% to show up 1st in the lists instead of 40 when you choose "not an alien", then cut and paste the 10%-200% values from cells Q1:Q20 into cells Q4:Q23 so that the first cell lines up with the dropdown box row.

  17. #17
    Registered User
    Join Date
    11-12-2013
    Location
    ILLINOIS
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: first option in a drop down menu

    Alright looks good. Appreciate the help.
    Tell me if this is possible:
    What if I decided to use a check box. The attacker is either human or alien. The user is automatically human and is able to choose from 10-200% but when pressing the alien check box then the alien level tab apears. They choose the tab and the % is automatically chosen for them depending on the level.

  18. #18
    Registered User
    Join Date
    11-12-2013
    Location
    ILLINOIS
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: first option in a drop down menu

    Alright great. Everything looks good to me.

    Could you help me with a different situation.

  19. #19
    Forum Contributor
    Join Date
    03-21-2013
    Location
    Corvallis, OR
    MS-Off Ver
    Excel 2010
    Posts
    174

    Re: first option in a drop down menu

    I can certainly try, though it probably won't happen tonight. (I'm about to get off the computer for the evening.) But go ahead and post your question. If it is vba related though, I would put it in the programming forum here: http://www.excelforum.com/excel-programming-vba-macros/, and paste a link to this thread.

  20. #20
    Registered User
    Join Date
    11-12-2013
    Location
    ILLINOIS
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: first option in a drop down menu

    I sent it via private message because its more specific.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 0
    Last Post: 06-25-2012, 03:22 PM
  2. Replies: 2
    Last Post: 03-01-2012, 11:47 PM
  3. Removing an option from a drop down menu after it is used.
    By heathD in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-26-2012, 12:53 PM
  4. Need an option added into a drop down menu
    By Ray_n_yellow in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-12-2009, 11:55 PM
  5. [SOLVED] add option to drop down menu
    By Vic in forum Excel General
    Replies: 1
    Last Post: 02-18-2005, 05:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1