Results 1 to 8 of 8
  1. #1
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: filtre cobobox with value in other combobox (2000 sr-1)

    ComboBox2 is filled by TEXTBOX_FILL_2. Add code to this procedure to add only items that satisfy the condition.

  2. #2
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: filtre cobobox with value in other combobox (2000 sr-1)

    Yes i know... but where insert the coidition in TEXTBOX_FILL_2...

    here:
    For Each Cell In AllCells
    NoDupes.Add Cell.Value, Cell.Value
    Next Cell

    or here:
    For Each Item In NoDupes
    Me.ComboBox2.AddItem Item
    Next Item

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: filtre cobobox with value in other combobox (2000 sr-1)

    In the first loop:

    For Each Cell In AllCells
    If ... Then
    NoDupes.Add Cell.Value, Cell.Value
    End If
    Next Cell

  4. #4
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: filtre cobobox with value in other combobox (2000 sr-1)

    wath you tink?

    For Each Cell In AllCells
    CODICE_TROVATO = Sheets(FOGLIO).Range("E" & RIGA)
    If CODICE_ATTUALE = CODICE_TROVATO Then
    NoDupes.Add Cell.Value, Cell.Value
    End If
    RIGA = RIGA + 1
    Next Cell

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: filtre cobobox with value in other combobox (2000 sr-1)

    I'd use

    For Each Cell In AllCells
    If Cell.Offset(0, 4) = CODICE_ATTUALE Then
    NoDupes.Add Cell.Value, Cell.Value
    End If
    Next Cell

  6. #6
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: filtre cobobox with value in other combobox (2000 sr-1)

    WOW!!!!
    big Prob...
    I want to use this condition for other sheets in my wbook project.
    But the column Cell.Offset(0, 4) not is fixed for all sheets but is variable, a time is column E a time is column F a time is column D... ecc
    The only param to distingiush the column is the header of column and is "SERV." for all sheets.
    this line of all sheet where is the header is the line 2 (from coloun A to column Z)
    Is possible to intercpet this header in range A2 to Z2 and set Cell.Offset(0, column_found) where column_found is the column with header "SERV."...

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: filtre cobobox with value in other combobox (2000 sr-1)

    Try this:

    Before the loop:

    Dim lngOffset As Long
    lngOffset = Application.WorksheetFunction.Match("SERV.", Sheets(FOGLIO).Range("A2:Z2"), 0) - 1

    In the loop:

    If Cell.Offset(0, lngOffset) =CODICE_ATTUALE Then

  8. #8
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    filtre cobobox with value in other combobox (2000 sr-1)

    click on button LUSTSTP
    combox1 is filled with value in column E.

    Now, with event change in combobox1, i want to fill combobox2 with all value in column F if based:
    CODICE_ATTUALE = Trim(Left((ComboBox1.Text), 4))
    in this case if CODICE_ATTUALE ="ES" combobox2 have 4579, "9H" combobox2 have 4564...
    in effect use CODICE_ATTUALE similar a key of filter
    Hope understand me.
    note: pass=SAL21

Posting Permissions

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