Results 1 to 5 of 5

Thread: AutoFilter Not Working By Date Due To Date Format Difference DD/MM/YYYY Vs MM/DD/YYYY

  1. #1
    Member
    Join Date
    Aug 2012
    Posts
    72
    Rep Power
    13

    AutoFilter Not Working By Date Due To Date Format Difference DD/MM/YYYY Vs MM/DD/YYYY

    Hi folks

    i am desperate and so, i did the cross-posting

    I have two combobox cmb_Dt_Inc (start date) and cmb_Dt_Fin (end date).

    I need show result in ListView.

    Cross-Post
    Filter by Date and Show in LisView

    Thanks
    Attached Files Attached Files

  2. #2
    Administrator Excel Fox's Avatar
    Join Date
    Mar 2011
    Posts
    1,402
    Rep Power
    10
    Hi Marreco,

    Replace the function with this

    Code:
    Public Sub ComboboxChange(cmbTarget As MSForms.ComboBox, iComboboxNo As Integer)
    
        Dim iColumnNo As Integer
        
    '   Muda a cor se tiver conteúdo
        If cmbTarget.Value = vbNullString Then
              cmbTarget.BackColor = &HFFFFFF
        Else: cmbTarget.BackColor = &H80C0FF
        End If
    
    '   seleciona a planilha fliltro e coloca o valor da combo
        iColumnNo = iComboboxNo
    
        If IsDate(cmbTarget.Value) Then
            Sheets("Filtro").Cells(2, iColumnNo) = CDate(cmbTarget.Value)
        Else
            Sheets("Filtro").Cells(2, iColumnNo) = cmbTarget.Value
        End If
        
        Call Pesquisa
    
    End Sub
    A dream is not something you see when you are asleep, but something you strive for when you are awake.

    It's usually a bad idea to say that something can't be done.

    The difference between dream and aim, is that one requires soundless sleep to see and the other requires sleepless efforts to achieve

    Join us at Facebook

  3. #3
    Member
    Join Date
    Aug 2012
    Posts
    72
    Rep Power
    13
    Hi.

    works, but when I use another combobox (cmb_Dt_Fin) are filtering only the last action of the combox.

    See my image

    thank you!!
    Attached Images Attached Images

  4. #4
    Member
    Join Date
    Aug 2012
    Posts
    72
    Rep Power
    13
    Hi.

    any idea?

    thanks

  5. #5
    Administrator Excel Fox's Avatar
    Join Date
    Mar 2011
    Posts
    1,402
    Rep Power
    10
    marreco, that is because of the way you have setup your filtering criteria. The way you have defined it, you are using a single row of data as your criteria. This works as an AND operator, and it isn't working as you intend (>= / <=)
    A dream is not something you see when you are asleep, but something you strive for when you are awake.

    It's usually a bad idea to say that something can't be done.

    The difference between dream and aim, is that one requires soundless sleep to see and the other requires sleepless efforts to achieve

    Join us at Facebook

Similar Threads

  1. Auto E-mail For Due Date Reminder Using Outlook
    By samd007 in forum Excel Help
    Replies: 4
    Last Post: 09-23-2013, 02:33 PM
  2. Replies: 5
    Last Post: 06-15-2013, 12:40 PM
  3. date format
    By Safal Shrestha in forum Excel Help
    Replies: 1
    Last Post: 01-02-2013, 02:53 PM
  4. How To Change Date Format in Excel
    By Oh!Calcutta in forum Excel Help
    Replies: 1
    Last Post: 11-01-2012, 09:36 PM
  5. Convert Text In YYYYMMDD Format To Date Format
    By S M C in forum Excel and VBA Tips and Tricks
    Replies: 1
    Last Post: 02-28-2012, 12:04 AM

Posting Permissions

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