Results 1 to 6 of 6

Thread: display unique values in combobox based on a cell

  1. #1

    display unique values in combobox based on a cell



    Register for a FREE account, and/
    or Log in to avoid these ads!

    hi i have a workbook with a form and some dependant comboboxes on. the last dependant combobox should check if there are a specific value in a cloumn, skip it and only list that without the value.
    below i am showing what the sheet look like...

    A1 = DISTRICT (combocbox1)
    B1 = TOWN (COMBOBOX 2)
    C1 = NAME (COMBOBOX3)
    D1 = NUMBER (COMBOBOX 4)

    the functionality for the dependant comboboxes is sorted out, if i click on combobox1 it pulls up the unique list of values for column A.
    Combobox 2 will only pull out the values related to combobox 1, etc.
    Column E is a date stamp which is automatically inserted into the sheet, and column F is what is inserted if the row has been processed. however, this is where i need assistance, if i pull up combobox 4, it will pull up everything in that column related to that Name in combobox 3. i need it to only pull up those rows that does not have "true" marked in column F.

    A B C D E F G
    1 east a town john 123 10 aug 2013 true
    2 east b town peter 124 10 aug 2013
    3 east b town mike 129 11 aug 2013
    4 west c town john 131 12 aug 2013
    5 east a town brad 133 12 aug 2013 true
    6 east b town peter 135 12 aug 2013 true
    7 east b town mike 136 12 aug 2013

  2. #2
    Acolyte millz's Avatar
    Join Date
    Aug 2013
    Location
    Singapore
    Posts
    32
    Articles
    0
    How about providing the code that you currently have for these combo boxes? Or provide a sample workbook.

  3. #3
    Book1(2).xlsm

    hi Millz
    on the Multipage Page 2 form the data is pulled from the Resultant sheet. When the Name is selected i want to only display those numbers that does not have "TRUE" marked on the Resultant sheet column H.
    Note: the multipage forms load based on priviledges added on the Source sheet using Environ$("USERNAME"). just add yours under Source sheet "J"

    thank you.

  4. #4
    Acolyte millz's Avatar
    Join Date
    Aug 2013
    Location
    Singapore
    Posts
    32
    Articles
    0
    Hi roninn, to be honest, this is some pretty decent coding done, and I don't know why you couldn't figure how to ignore those with "TRUE". Did you just take over this project or something?

    Anyway, in the sub Private Sub BxDC_StaOIC_AfterUpdate(), add this condition:
    Code:
                Do
                    If InStr(1, Cl.Offset(0, 5), "true", vbTextCompare) = 0 Then
                        .List_DC_StaIncNo.AddItem Cl.Offset(0, 1).Value
                        'MsgBox ("select inc no's: " & Cl.Offset(0, 1).Value)
                    End If
                Set Cl = rSource.FindNext(Cl)
                Loop While Not Cl Is Nothing And Cl.Address <> ClAddress

  5. #5
    hi Millz

    thank you for that, yes i have inherited this project...

  6. #6
    Acolyte millz's Avatar
    Join Date
    Aug 2013
    Location
    Singapore
    Posts
    32
    Articles
    0
    Oh, I see. You're welcome, and good luck with the project

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •