Results 1 to 9 of 9
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Filtre data with user form... (2000 sr-1)

    I have this sheet MANCA with a button to call a userform.
    I would want through this userform filtre the data into MANCA sheet.
    Example:

    param of filtre from tbox SPORT column A
    param of filtre from tbox PERIODO column C
    param of filtre from tbox SK-DESCRIZIONE column D
    param of filtre from tbox DATA RIF. column H

    Assuming for example i set from userform :SPORT =4501 show all data refered from this one param

    Assuming for example i set from userform :SPORT =4501 and PERIODO= decadale show all data refered from this 2 param
    ecc...

    hope i am clear.
    Tks

  2. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Filtre data with user form... (2000 sr-1)

    MS MVP Debra DAgliesh has a page of Excel Filters -- AutoFilter Programming whcih should be adaptable

    Steve

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

    Re: Filtre data with user form... (2000 sr-1)

    It is impossible to tell which fields you want to filter and which fields you don't want to filter. All combo boxes have a value.

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

    Re: Filtre data with user form... (2000 sr-1)

    ... se now into Private Sub cmdElabora_Click() after i have pressed this button all variable are filled with value...
    And with this value i would want to filtre data into sheet...in the macro Sub SHOW_FILTRED_DATA() i want the code to filtte data.

    Attached new project

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

    Re: Filtre data with user form... (2000 sr-1)

    The following code will filter the worksheet. It will always filter on columns A, B, C and H, not on only one or two of them.

    Sub SHOW_FILTRED_DATA()
    With Worksheets("MANCA").Range("A4")
    .AutoFilter Field:=1, Criteria1:=INS_SPORT
    .AutoFilter Field:=2, Criteria1:=SK
    .AutoFilter Field:=3, Criteria1:=NUM_PERIODO
    .AutoFilter Field:=8, Criteria1:=DATA
    End With
    End Sub

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

    Re: Filtre data with user form... (2000 sr-1)

    nice....
    But using this userform is possible to use only one or more param for extraction?
    Example:
    filtre only for SPORT
    or
    filtre only for SPORT and NUM_PERIODO
    or
    filtre only for NUM_PERIODO and SK
    ecc...

    attached new file..

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

    Re: Filtre data with user form... (2000 sr-1)

    As it is now, there is no way to determine on which fields the user wants to filter.
    One way would be to add check boxes to specify which fields you want to filter on.
    Another way would be to create a command button for each type of filter (a command button for "Filter on SPORT", a command button for "Filter on SPORT and NUM_PERIODO" etc.)

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

    Re: Filtre data with user form... (2000 sr-1)

    GOOD IDEA!...
    I make an experiment with check box, but i have see when i click on a ckbox the label of this is show with a little line around. not is possible to not show that?

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

    Re: Filtre data with user form... (2000 sr-1)

    > not is possible to not show that?

    No, that is the way Windows shows that the check box has the focus.

Posting Permissions

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