+ Reply to Thread
Results 1 to 13 of 13

Populate a single sheet with multiple entries from a drop down list

  1. #1
    Registered User
    Join Date
    09-24-2012
    Location
    Mansfield
    MS-Off Ver
    Windows 7
    Posts
    7

    Populate a single sheet with multiple entries from a drop down list

    Hi this is my first posting on here so I am hoping someone is kind enough to help me. I am OK at putting a drop down validation list in my Excel 2007 spreadsheet but what I want to do is be able to chose multiple choices and these choices made populate a single cell followed by a comma each time a choice is made.
    Sorry the title should read Single Cell not Single Sheet !! oops a senior moment
    Last edited by Zuerner; 09-24-2012 at 05:03 PM.

  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: Populate a single sheet with multiple entries from a drop down list

    Zuerner,

    Welcome to the forum!
    So if you have headers in row 1 and actual data starts in row 2, and the drop-down validation lists are in columns, A B and C, then in cell D2 and copied down you could have:
    Please Login or Register  to view this content.
    Is something like that what you mean?
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    09-24-2012
    Location
    Mansfield
    MS-Off Ver
    Windows 7
    Posts
    7

    Re: Populate a single sheet with multiple entries from a drop down list

    Quote Originally Posted by tigeravatar View Post
    Zuerner,

    Welcome to the forum!
    So if you have headers in row 1 and actual data starts in row 2, and the drop-down validation lists are in columns, A B and C, then in cell D2 and copied down you could have:
    Please Login or Register  to view this content.
    Is something like that what you mean?
    I think I haven't made myself clear. I have got various cells that is a staff rota, so in each cell I need to put in a number of names so for example 5 people will be on phone duty while another 4 might be doing the post. Each cell will have the dropdown in it so I can then just click and select the names that go into each cell. Hope you understand what I am trying to achieve.Many thanks Martin

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

    Re: Populate a single sheet with multiple entries from a drop down list

    I'm still a little confused so...

    To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.
    To attach a file, click the "Go Advanced" button and then click the paperclip icon to open the Manage Attachments dialog.

  5. #5
    Registered User
    Join Date
    09-24-2012
    Location
    Mansfield
    MS-Off Ver
    Windows 7
    Posts
    7

    Re: Populate a single sheet with multiple entries from a drop down list

    sample.xlsxsample.xlsxHere is a sample...thankyou

  6. #6
    Registered User
    Join Date
    09-24-2012
    Location
    Mansfield
    MS-Off Ver
    Windows 7
    Posts
    7

    Re: Populate a single sheet with multiple entries from a drop down list

    Hi I have uploaded a sample for you..thanks Martin

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

    Re: Populate a single sheet with multiple entries from a drop down list

    Martin,

    I think I get it now. You want to choose multiple names from the drop-down list to populate the cell the drop-down list is in. If that is the case, you're going to have to use VBA. Are you ok with a VBA solution?

  8. #8
    Registered User
    Join Date
    09-24-2012
    Location
    Mansfield
    MS-Off Ver
    Windows 7
    Posts
    7

    Re: Populate a single sheet with multiple entries from a drop down list

    You have got it in one! Seriously that's exactly what I want to do, I have used vba before but need some help with it, are you OK to help?? Thanks Martin

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

    Re: Populate a single sheet with multiple entries from a drop down list

    Martin,

    Attached is a modified version of your sample file. I have made a lot of changes.
    First of all, you'll notice the 'Rota' sheet now has a different layout. You can enter the date of the Week Commencing in cell B1, and the days of the week in B3:F3 will automatically update. They are formatted to show the day of the week as well as the date.

    Secondly, I renamed sheet 'Data' to be 'Lists'. In B1 is the header "Names" and starting in cell B2 and going down without skipping any rows (so no blanks in the list) is the list of names. I also edited the named ranged "names". It is now named "list_Names" and is a dynamic named range that is defined with this formula:
    Please Login or Register  to view this content.
    The reason it uses column B is because column A is hidden. It is a reserved column for the userform so that it can sort the name lists as names get shuffled around between assigned and unassigned.


    Next is where the VBA stuff starts. I used the worksheet_selectionchange event for sheet 'Rota'. The event will only trigger when a single cell withing B4:F6 is selected. Techincally its B4:F(last row), but the last row in this example is 6. The code used for the selectionchange event is:
    Please Login or Register  to view this content.


    What that code does is pull up the userform named frm_AssignDuty. That is a userform I created that contains 2 listboxes and some buttons. The left-hand listbox is the list of unassigned names. The right-hand listbox is the list of assigned names. So the form opens, you can choose whichever unassigned names you want and move them over to the assigned names and click OK, which will fill the selected cell with the list of names and close the form. You don't have to use the ">" and "<" buttons to move names over, you can also double-click on a name and it will get moved that way, so both options are available (double-clicking and using the buttons). Pressing cancel will close the form without making any changes to the cell. The list of unassigned names is based on the list of full names and then it removes any names that have already been assigned in the same column. For example, if in cell B4 you assign Name01 and Name03, then in cell B5 those two names will no longer be available because they have already been assigned. If you want to free a name up again, click on cell B4 and unassign the name.
    Attached Files Attached Files
    Last edited by tigeravatar; 09-25-2012 at 05:38 PM. Reason: Added note about hidden column A in sheet 'Lists'

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

    Re: Populate a single sheet with multiple entries from a drop down list

    Here is the full code used by the userform:
    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    09-24-2012
    Location
    Mansfield
    MS-Off Ver
    Windows 7
    Posts
    7

    Re: Populate a single sheet with multiple entries from a drop down list

    That's fantastic thank you so, so much, it's so much better doing it your way than the way I was thinking of doing it, or rather hoping to do it! Thanks again..Martin
    Last edited by Zuerner; 09-26-2012 at 03:27 PM.

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

    Re: Populate a single sheet with multiple entries from a drop down list

    The code will already expand dynamically. Its based off of the contents in column A. So if column A is populated, that row will trigger the code.

  13. #13
    Registered User
    Join Date
    09-24-2012
    Location
    Mansfield
    MS-Off Ver
    Windows 7
    Posts
    7

    Re: Populate a single sheet with multiple entries from a drop down list

    I realised that soon after I sent the last message, it sometimes take me a while to work things out :-) seriously it will save us so much time at work working out a rota for fourty odd people..thanks again

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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