+ Reply to Thread
Results 1 to 3 of 3

Auto populate cells with a dropdown box

  1. #1
    Registered User
    Join Date
    04-28-2011
    Location
    seattle, wa
    MS-Off Ver
    Excel 2007
    Posts
    1

    Auto populate cells with a dropdown box

    Hello All,

    New to the forum and couldn't find an answer to this question, if someone could help me out it would be greatly appreciated.

    Is there a way to autopopulate cells with a drop down box? I would like to have a drop down box where if I select one value in that box (say "fruit") it would automatically display "fruit" in cell A1. Then when I use the SAME drop down box I select something else (say "meat") it would automatically display in "meat" in the next row under "fruit" in cell A2.

    Is this possible? I've tried fussing around with macros, and VBA a little bit, but I don't know nearly enough about either to make this happen. I would even be okay with using a simpler method like INDEX(MATCH()) or a LOOKUP function if that would work.

    Any help would be great and much appreciated... Thanks!!!

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Auto populate cells with a dropdown box

    lukeshow,

    Because you want to use the same drop-down box each time, you'd have to use a macro to accomplish your request. Otherwise cell A1 would constantly be changing too. Specifically, you'd need a Worksheet_Change event.

    Instructions (I have also included an attachment that contains these instructions with screenshots):
    1. Save a copy of the workbook you want to put the code in
      • Always test code or suggestions in a copy, not the original, just in case it does not work as intended
    2. Copy the code below
    3. Open the workbook copy and press ALT+F11 to open the Visual Basic Editor
    4. Double-click on the worksheet that contains the drop-down list cell
    5. Paste the code
    6. Save the copy
    7. See if it works

    Please Login or Register  to view this content.

    Notes:
    -This sample code assumes the drop-down list is in cell B1

    Hope that helps,
    ~tigeravatar
    Attached Files Attached Files

  3. #3
    Valued Forum Contributor tlafferty's Avatar
    Join Date
    04-08-2011
    Location
    United States, Tacoma, WA
    MS-Off Ver
    Excel 2010, Excel 2013 Customer Preview
    Posts
    1,112

    Re: Auto populate cells with a dropdown box

    Embed a combobox in your sheet.

    Use this code:
    Please Login or Register  to view this content.
    If your question has been satisfactorily addressed, please consider marking it solved. Click the Thread Tools dropdown and select Mark thread as solved.
    Also, you might want to add to the user's reputation by clicking the star icon in the lower left corner of the post with the answer- it's why we do what we do...

    Thomas Lafferty
    Analyst/Programmer

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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