+ Reply to Thread
Results 1 to 17 of 17

Populating a ComboBox from two columns (as list not beside each other)?

  1. #1
    Forum Contributor
    Join Date
    08-29-2017
    Location
    London England
    MS-Off Ver
    2016
    Posts
    194

    Populating a ComboBox from two columns (as list not beside each other)?

    Hi all,

    I have a table: ALL Service Packs with 2 columns: Service Packs - A Status and Service Packs - B Status.

    I'm trying to make a combobox which is populated with All of our possible service packs A and B as well, but I need to keep this table as it is, as the formulas look into the different columns for A and B statuses..

    but this code:

    Please Login or Register  to view this content.
    only returns the first column not both of them...

    Can someone help please?

  2. #2
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,151

    Re: Populating a ComboBox from two columns (as list not beside each other)?

    Try:
    Please Login or Register  to view this content.

  3. #3
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Populating a ComboBox from two columns (as list not beside each other)?

    Perhaps:-
    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    08-29-2017
    Location
    London England
    MS-Off Ver
    2016
    Posts
    194

    Re: Populating a ComboBox from two columns (as list not beside each other)?

    no those both put the 2 columns into the same field.. like this:

    Attachment 618993

    Blue is A status - Orange is B status and I can only choose the A status ones.. the B-s just show up beside.. I need to be able to select all the packs regardless of the status or which column they are in.

  5. #5
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,151

    Re: Populating a ComboBox from two columns (as list not beside each other)?


    Both columns are visible - see attachment.
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    08-29-2017
    Location
    London England
    MS-Off Ver
    2016
    Posts
    194

    Re: Populating a ComboBox from two columns (as list not beside each other)?

    No I need it like A, B ,C ,D, E, 100, 200, 300, 400, 500 all below each other, so I can choose just A or just 500, Sorry I'm not the best at explaining.

  7. #7
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,151

    Re: Populating a ComboBox from two columns (as list not beside each other)?

    Attach an example with some false data and an example of the appearance of the list box after loading data into it.
    Link to your attachment not working.
    Attached Images Attached Images

  8. #8
    Forum Contributor
    Join Date
    08-29-2017
    Location
    London England
    MS-Off Ver
    2016
    Posts
    194

    Re: Populating a ComboBox from two columns (as list not beside each other)?

    I have added a how I would like the combo box to look like - macro, only the table that it is based on is not right, as I would need the table to look like as in A and B columns.
    Attached Files Attached Files

  9. #9
    Forum Contributor
    Join Date
    08-29-2017
    Location
    London England
    MS-Off Ver
    2016
    Posts
    194

    Re: Populating a ComboBox from two columns (as list not beside each other)?

    I was thinking maybe with an array but I'm rubbish in arrays and I couldn't get it to work..

  10. #10
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,151

    Re: Populating a ComboBox from two columns (as list not beside each other)?

    This is "Array" ...
    Please Login or Register  to view this content.

    Edit:

    Try

    Please Login or Register  to view this content.
    Last edited by mjr veverka; 04-06-2019 at 03:33 PM.

  11. #11
    Forum Contributor
    Join Date
    08-29-2017
    Location
    London England
    MS-Off Ver
    2016
    Posts
    194

    Re: Populating a ComboBox from two columns (as list not beside each other)?

    Oh wow.. that seems so complicated :/ I wouldn't be able to fix it if something went wrong..

  12. #12
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,151

    Re: Populating a ComboBox from two columns (as list not beside each other)?


    Try this way:
    Please Login or Register  to view this content.

  13. #13
    Forum Contributor
    Join Date
    08-29-2017
    Location
    London England
    MS-Off Ver
    2016
    Posts
    194

    Re: Populating a ComboBox from two columns (as list not beside each other)?

    Oh I see what you did there I'm gonna give this a go.. Thanks!

    I see you can do arrays tho.. would something like this not be possible? I tried that below but I think I got a mismatch when I tried to debug.print it, so I sort of gave up on it.. or is that still a 2D array thats why its not working?

    Please Login or Register  to view this content.

  14. #14
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,151

    Re: Populating a ComboBox from two columns (as list not beside each other)?

    You've made it even more complicated because you've just made a "matryoshka doll", you put two areas (arrays) into the another area/array (variable myarray), like two small boxes into another greater box.

    Exemplary "matryoshka solution", one of many:

    Please Login or Register  to view this content.
    What kind of solution are you looking for ? You already have 3 at this moment ...

  15. #15
    Forum Contributor
    Join Date
    08-29-2017
    Location
    London England
    MS-Off Ver
    2016
    Posts
    194

    Re: Populating a ComboBox from two columns (as list not beside each other)?

    hahaha As simple syntax as possible.. I struggle to accept that Excel can't do this from 3 lines of code.. but if it can't then it can't..
    Last edited by LIL2606; 04-07-2019 at 11:33 AM. Reason: typo

  16. #16
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,151

    Re: Populating a ComboBox from two columns (as list not beside each other)?

    The subject of your post no. 1 is completely different than your final post/conclusion.

  17. #17
    Forum Contributor
    Join Date
    08-29-2017
    Location
    London England
    MS-Off Ver
    2016
    Posts
    194

    Re: Populating a ComboBox from two columns (as list not beside each other)?

    Sorry I was being difficult Thank you for all your help!

+ 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] Trouble with populating ComboBox list with visible cells in filtered range
    By brucemc777 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 02-09-2019, 08:02 PM
  2. Replies: 3
    Last Post: 03-22-2018, 11:25 AM
  3. Populating an ActiveX combobox from a dynamic list
    By Mel_GC in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-23-2014, 11:10 AM
  4. Populating a ComboBox without having a list of cells on your sheet?
    By RootBeerSoup in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-29-2014, 11:59 AM
  5. Populating Userform ComboBox Using Items from Content Control Combobox
    By anarxo in forum Word Programming / VBA / Macros
    Replies: 2
    Last Post: 01-17-2014, 01:00 PM
  6. Combobox Populating via a list or directly typing
    By nighttrainrex in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-30-2011, 05:03 PM
  7. Populating the list in a combobox based off the value chosen in another combobox
    By Mervil in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-21-2010, 11:50 AM

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