+ Reply to Thread
Results 1 to 6 of 6

Auto fill dependent drop-down list if only one choice

  1. #1
    Registered User
    Join Date
    05-05-2015
    Location
    Pittsburgh, PA
    MS-Off Ver
    2007/2010/2011/2013
    Posts
    18

    Auto fill dependent drop-down list if only one choice

    I have the attached my spreadsheet that requests new student machine orders.

    I have many dependent drop-down lists in this spreadsheet which work as expected and they will clear if the parent drop-down options changes.

    I am trying to do the following:

    I would like to auto-populate a cell if there is only one option in the drop down list for that cell. I would like this function for all cells that have one option. Since each drop-down is dependent on another I am not sure how to make this work.

    (Example: If I choose Apple iMac the OS column will automatically select Yosemite )

    If there is an easier way to do this that the way that I have chosen I am open to suggestions.

    Thanks in advance for any assistance.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,945

    Re: Auto fill dependent drop-down list if only one choice

    Use the worksheet's change event
    1) Copy this code.
    2) Right-Click the sheet tab of interest.
    3) Select "View Code"
    4) Paste the code into the window that appears.
    5) Save the file as a macro-enabled .xlsm file.
    6) Make changes to ranges as needed

    Please Login or Register  to view this content.
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Registered User
    Join Date
    05-05-2015
    Location
    Pittsburgh, PA
    MS-Off Ver
    2007/2010/2011/2013
    Posts
    18

    Re: Auto fill dependent drop-down list if only one choice

    Thank you Bernie. I am unable to get this to work. I am new to VBA code. I have another change event for this sheet. If I copy and paste the code above into the sheet I get a naming error. If I try the following nothing happens.

    Can you tell me what is wrong? I have uploaded my spreadsheet with the updated code from you.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by betheeem; 05-12-2015 at 11:55 AM.

  4. #4
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,945

    Re: Auto fill dependent drop-down list if only one choice

    This is how you would apply the code to C4:C137

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    05-05-2015
    Location
    Pittsburgh, PA
    MS-Off Ver
    2007/2010/2011/2013
    Posts
    18

    Re: Auto fill dependent drop-down list if only one choice

    Sorry Fotis. I fixed my post. Thanks for the note.

  6. #6
    Registered User
    Join Date
    05-05-2015
    Location
    Pittsburgh, PA
    MS-Off Ver
    2007/2010/2011/2013
    Posts
    18

    Re: Auto fill dependent drop-down list if only one choice

    Thank you Bernie. This did it. I was researching this for days.

+ 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. Multiple Time Stamps depending on choice in Drop Down List Choice
    By insayah in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-25-2022, 09:53 AM
  2. Replies: 2
    Last Post: 03-27-2014, 06:10 PM
  3. Replies: 7
    Last Post: 11-20-2013, 04:00 PM
  4. Replies: 2
    Last Post: 08-13-2013, 05:27 PM
  5. Replies: 1
    Last Post: 05-24-2007, 12:37 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