+ Reply to Thread
Results 1 to 4 of 4

VBA Define Date Variable as Filter Criteria

  1. #1
    Registered User
    Join Date
    06-01-2014
    Posts
    17

    VBA Define Date Variable as Filter Criteria

    Hello to all,

    I am a beginner at VBA and I trying to make a Workbook that will filter the raw data of one sheet based on some criteria and the copy the matching data to summary sheet. I have managed to work it out for the some of the criteria but I stacked on how to define a Date criteria and sort it out. Also, I have a field in Date Timestamp format (YYYY-MM-DD HH:MM:SSTX) which I want also to use as filtering criteria but to input it as DD-MM-YYYY.

    I attach the file with an example and the VBA code.

    Any help will be greatly appreciate.

    Summary Date.xlsm

    Thank you all.

  2. #2
    Valued Forum Contributor tehneXus's Avatar
    Join Date
    04-12-2013
    Location
    Hamburg, Germany
    MS-Off Ver
    Work: MS-Office 2010 32bit @ Win8 32bit / Home: MS-Office 2016 32bit @ Win10 64bit
    Posts
    944

    Re: VBA Define Date Variable as Filter Criteria

    Hi,

    try the following:
    Please Login or Register  to view this content.
    Please use [CODE]-TAGS
    When your problem is solved mark the thread SOLVED
    If an answer has helped you please click to give reputation
    Read the FORUM RULES

  3. #3
    Registered User
    Join Date
    06-01-2014
    Posts
    17

    Re: VBA Define Date Variable as Filter Criteria

    Thank you tehneXus, it is working with both Timestamp and Short Date. Is is is possible when a filter them based on Date filters not to modify the Input Data Sheet, as well as if I clear all the criteria and run the code to return all the data to the summary sheet?
    Because, it is working fine but once I sort the data using a date I can not undo it.

    Also, thank you very much for cleaning the code at the non-date filter criteria.
    Last edited by KostasK8; 11-24-2014 at 03:22 PM.

  4. #4
    Registered User
    Join Date
    06-01-2014
    Posts
    17

    Re: VBA Define Date Variable as Filter Criteria

    Hello to all,

    I tested and discovered that after filtering based on date, filtering again with no date criteria it reveals again all the values. Is it possible to make when all the criteria are blank to return all the data?

    Also at the short date filter, i tried it and it wasnt sorting the data, which is weird since for the date time-stamp is working fine : should I put the date with in #DD-MM-YYYY#?
    Please Login or Register  to view this content.
    Last edited by KostasK8; 11-25-2014 at 05:01 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. VBA Multiple Criteria / Variable Filter Help!
    By mzs in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-07-2013, 08:05 AM
  2. Define Variable as Current Date minus 7
    By Jiptastic in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-24-2013, 07:25 PM
  3. Replies: 1
    Last Post: 10-27-2012, 02:54 AM
  4. Replies: 3
    Last Post: 06-26-2010, 02:43 PM
  5. How do I identify Filter criteria or variable graph title?
    By Excel_loser in forum Excel General
    Replies: 0
    Last Post: 10-04-2005, 03:05 PM

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