+ Reply to Thread
Results 1 to 1 of 1

appplying filter without changing date format

  1. #1
    Registered User
    Join Date
    12-21-2012
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    21

    appplying filter without changing date format

    Hi

    I am trying to filter data which is before or after 2 dates (these dates are created using a formula in these cells) stored in different sheet in same workbook.
    dates are currently in "dd/mm/yyyy" format but after using below code first date appears in filter as "mm/dd/yyyy" where as second date stays same. both dates needs to stay in same format "dd/mm/yyyy". any help will be much appreciated.

    Dim date1 As Date, date2 As Date

    date1 = Sheets("summary").Range("A1").Value
    date2 = Sheets("summary").Range("B1").Value

    Sheets("test").Range("A1").AutoFilter Field:=12, Criteria1:="<" & date1 & "", Operator:=xlOr, Criteria2:=">" & date2 & ""
    Attached Images Attached Images

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1