+ Reply to Thread
Results 1 to 6 of 6

Taking values from drop down into one cell

  1. #1
    Forum Contributor
    Join Date
    11-22-2006
    MS-Off Ver
    2010
    Posts
    201

    Taking values from drop down into one cell

    Hi all, hope someone can help start off with this VBA, see attached file.

    See the sheet "Data". Ideally the user would select B5 for example and get a drop down / box they could select multiple values from, the items in the drop down box would be those in the "Options" sheet and specifically B7:B16. When selecting in C5 they would get a selection from the "Options" sheet and C7:C22

    The cell in B5 would then contain the data the user selected, so it could contain "Item 1 - 1, Item 1 - 3 , Item 1 - 10" for example.

    Hope to hear from you.

    Many thanks
    tinkerbelle
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor Eastw00d's Avatar
    Join Date
    02-29-2020
    Location
    Breda, NL
    MS-Off Ver
    2016, 2019
    Posts
    833

    Re: Taking values from drop down into one cell

    You dont have to do this with VBA, simply use datavalidation:
    Select cells in which you want the drop-down list to appear. (In your case Data - B5:B8)
    Excel Data Validation
    On the Data tab, in the Data Tools group, click the Data Validation button, then select the Data Validation menu option.
    On the Settings tab, set the Validation criteria, Allow: criteria as List.
    Click in the Source field then select cells that contain the list items (or type the items in the source field, separated by commas). (Options - B7:B16)
    Make sure that both the Ignore blank and In-cell dropdown check boxes are checked.
    Click OK.
    and likewise for the next group
    Cheers
    Erwin
    I started learning VBA because I was lazy ...
    Still developing.... being more lazy...

  3. #3
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,210

    Re: Taking values from drop down into one cell

    As the above but select b5 as the cell
    select data validation as a list and put the source as =Options!B$6:B$22

    you can now copy this cell to the rest of your table b5:i8

    I included 6 too give you blanks as the first value and deliberately made all the ranges to 22 as you copy it sideways the Bs become Cs etc

  4. #4
    Forum Contributor
    Join Date
    11-22-2006
    MS-Off Ver
    2010
    Posts
    201

    Re: Taking values from drop down into one cell

    hi, thank you both so much.

    yes i would have used data validation, but i want the user to be able to enter more than one value into the cell. eg: The cell in B5 would then contain the data the user selected, so it could contain "Item 1 - 1, Item 1 - 3 , Item 1 - 10". If this can be produced without VBA that would be great.

    Thanks!

  5. #5
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,210

    Re: Taking values from drop down into one cell

    missed the multiple, its usually a pain to do, especially if you subsequently want to use the values
    https://trumpexcel.com/select-multip...wn-list-excel/

    or

    https://www.contextures.com/excel-da...n-listbox.html

    are a start

  6. #6
    Forum Contributor
    Join Date
    11-22-2006
    MS-Off Ver
    2010
    Posts
    201

    Re: Taking values from drop down into one cell

    Davsth - oh great thanks, just looking at contextures, Debra seems to have a process to follow - thanks again! Luce

+ 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. [SOLVED] Drop down box not working taking from web
    By harishb63 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-03-2013, 04:41 AM
  2. [SOLVED] Merge rows while taking the weighted averages for the new cell values
    By engineerlady in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-18-2013, 04:10 PM
  3. [SOLVED] Taking only the numeral values from a cell and no text
    By Bearack in forum Excel General
    Replies: 4
    Last Post: 06-26-2012, 12:03 PM
  4. Taking cell values from Dashboard, and based on a value load in one of two sheets
    By califire in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-11-2011, 11:36 AM
  5. Taking values from one cell to a different workbook
    By Bookerbesh in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-19-2010, 01:57 PM
  6. Taking values from a cell to use in a macro
    By dziw in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-13-2007, 11:42 AM
  7. [SOLVED] HOW DO I DRAG AND DROP W/O TAKING CELL BORDER?
    By don perkins in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-12-2006, 09:10 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