+ Reply to Thread
Results 1 to 6 of 6

Complicated listbox code required...

Hybrid View

  1. #1
    Registered User
    Join Date
    08-27-2009
    Location
    Milton Keynes
    MS-Off Ver
    Excel 2007
    Posts
    45

    Complicated listbox code required...

    I would really appreciate it if you could take a look at the following and perhaps offer some advice...

    I have data within a work sheet set out in the following way:

    A B C D E F G H
    1 Allocation Ref UPI AllocStatus AllocType TransType AllocStartDate PeriodDays Notes
    2 1AD RENA1 Processing Rental Online 02/03/13 3 ...
    3 1AD RENA2 Ready Rental Online 02/03/13 3 ...
    4 1AD RETA3 Ready Rental Online 02/03/13 3 ...
    5 2CB RENB3 Processing Sale Instore 06/07/13 2 ...
    6 2CB RENA5 Ready Sale Instore 06/07/13 2 ...
    7 3FE REN4D Processing Rental Online 13/09/13 5 ...
    8 4BE RET44 Ready Sale Instore 22/11/2013 5 ...



    I have a two listbox's, a textbox and a command button on a Userform, Listbox1 and Listbox2, textbox1 and commandbutton1.

    I would like Listbox1 to populate itself with data from columns A, D, E, F and G of "Sheet1".

    However, Listbox1 will need to sort Column A of the worksheet "AllocationRef", into one instance of each reference found. For example, using the above data listbox1 would look like this:

    LISTBOX1
    (Returns Column "A" data) (Returns Column "D" data) (Returns Column "E" data) (Returns Column "F" data) (Returns Column "G" data)
    1AD Rental Online 02/03/13 3
    2CB Sale Instore 06/07/13 2
    3FE Rental Online 13/09/13 5
    4BE Sale Instore 22/11/13 5

    When a user selects a row of the listbox, e.g. "1AD", the textbox would show that there are 3 items associated with that reference. In the same way "2CB" would say there are 2 items associated etc.

    When a user selects a row and then clicks the command button, I would like listbox2 to populate itself with the data in column B and C, relating to the selected ref ( i'll use "1AD" as the selected row in this example)...

    LISTBOX2
    (Returns Column "B" data) (Returns Column "C" data)
    RENA1 Processing
    RENA2 Ready
    RETA3 Ready

    Hopefully that makes sense... Thanks in advance.
    Last edited by RayJay01; 11-16-2013 at 04:32 PM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Complicated listbox code required...

    Cross-posted at http://www.mrexcel.com/forum/excel-q...-required.html
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    08-27-2009
    Location
    Milton Keynes
    MS-Off Ver
    Excel 2007
    Posts
    45

    Re: Complicated listbox code required...

    Cross posted?

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Complicated listbox code required...


  5. #5
    Registered User
    Join Date
    08-27-2009
    Location
    Milton Keynes
    MS-Off Ver
    Excel 2007
    Posts
    45

    Re: Complicated listbox code required...


  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,948

    Re: Complicated listbox code required...

    What shg is saying is that you have posted the same thing on (at least) 2 other forums. Our Rule 8 of our Forum RULES stiplulates...Do not crosspost your question on multiple forums without including links here to the other threads on other forums.

    Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post.

    Read this to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (not just this site).
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ 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. Create Circular link between two workbooks
    By DUrekew in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-10-2013, 05:55 PM
  2. Complicated and/or statment help required
    By AllenMead in forum Excel General
    Replies: 15
    Last Post: 10-10-2010, 08:42 AM
  3. Error 424 Object Required Error when Using AddItem to ListBox Generated in Code
    By jclark419 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-01-2010, 12:47 PM
  4. Listbox data required
    By kuzniaj in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-23-2006, 01:34 PM
  5. Complicated formula help required
    By recklaw in forum Excel General
    Replies: 10
    Last Post: 03-21-2006, 08:50 AM

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