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

    Re: Ffiter not work!!! (2000 sr 1)

    There is no userform in the workbook.

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

    Re: Ffiter not work!!! (2000 sr 1)

    Sorry....

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

    Re: Ffiter not work!!! (2000 sr 1)

    I think it is because VBA expects an English date formatting code, not an Italian one. Try changing the line
    <code>
    RNG.AutoFilter Field:=10, Criteria1:=Format((Me.ComboBox3), "GG/MM/AAAA")
    </code>
    to
    <code>
    RNG.AutoFilter Field:=10, Criteria1:=Format((Me.ComboBox3), "dd/mm/yyyy")</code>

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

    Re: Ffiter not work!!! (2000 sr 1)

    wow!!!
    Why / insted /?!?

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

    Re: Ffiter not work!!! (2000 sr 1)

    You probably don't need it, but I do because my computer displays dates as 22-02-2007 instead of 22/02/2007. The backslash before / tells VBA to treat / as a literal character.

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

    Re: Ffiter not work!!! (2000 sr 1)

    Hans i cannot test you suggestion...
    Because now the macro go in error in userform event button8...here:
    Set WS = Worksheets("L0951")

    Set RNG = WS.Range(WS.[A2], WS.UsedRange.SpecialCells(xlCellTypeLastCell)).Res ize(columnsize:=12)

    PRIMO = Me.ComboBox1.Text
    SECONDO = Me.ComboBox2.Text
    TERZO = Me.ComboBox3.Text
    errror here "1004"
    RNG.AutoFilter Field:=8, Criteria1:=PRIMO
    errror here "1004"
    RNG.AutoFilter Field:=12, Criteria1:=SECONDO

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

    Re: Ffiter not work!!! (2000 sr 1)

    i don't know what you entered in the combo boxes. In the example you gave in the first post in this thread, the code works OK.

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

    Re: Ffiter not work!!! (2000 sr 1)

    No work...

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

    Re: Ffiter not work!!! (2000 sr 1)

    Here is the workbook with the userform.
    Attached Files Attached Files

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

    Re: Ffiter not work!!! (2000 sr 1)

    Select 09/07/2006 and 4580 in Fil/gruppo, press ESTRAI...

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

    Re: Ffiter not work!!! (2000 sr 1)

    I don't get an error message.

    But please note that the values in column J are inconsistent. Some are real date values (right-aligned) and others are text values looking like dates (left-aligned). I don't know if that has to do with your problem.

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

    Ffiter not work!!! (2000 sr 1)

    Why the macro not filter with this paramenter...
    In thsi case if i filtre manul i have one line but with this piece have zero line filtered....


    PRIMO = Me.ComboBox1.Text (SOSPESO SCADUTO DA OLTRE 3 MESI)
    SECONDO = Me.ComboBox2.Text (4580)
    TERZO = Me.ComboBox3.Text (28/08/2006)

    RNG.AutoFilter Field:=8, Criteria1:=PRIMO
    RNG.AutoFilter Field:=12, Criteria1:=SECONDO

    If TERZO = "99/99/9999" Then
    RNG.AutoFilter Field:=10, Criteria1:=TERZO 'CDate(Me.ComboBox3.Text)
    End If
    If TERZO = "31/12/9999" Then
    RNG.AutoFilter Field:=10, Criteria1:=TERZO 'CDate(Me.ComboBox3.Text)
    End If
    If Not TERZO = "99/99/9999" And Not TERZO = "31/12/9999" Then
    RNG.AutoFilter Field:=10, Criteria1:=Format((Me.ComboBox3), "GG/MM/AAAA")
    End If

Posting Permissions

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