Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

How to find data between two dates in excel VBA?

I found a solution and wanted to share it :

      Records in between two specific dates easily can be filtered using drop-down lists . Drop-down lists were filled with unique values as ascending order using Ado connection. Thus, it is easier to choose between the dates on the worksheet. 

 The filtered data can be copied to other sheet if it wished.

Watch the video to see how it's done  and download example file : https://youtu.be/baHyGS7i9n0

user-image
Question added by kadrleyn kadr leyn , engineer , www.merkez-ihayat.com
Date Posted: 2017/08/08
Firas Shahadi
by Firas Shahadi , Human Resources Director , SAUDI UNION

One way that you use the worksheet function in VBA

Application.WorksheetFuncdtions.DateDif()

Varsha Pereira
by Varsha Pereira , Executive Secretary to Chairman , Pure Gold Jewellers L.L.C.

Let's say that your data range has a header in cell D28 that says "Date".Put the word "Date" in cells B2 and C2.In B3, enter the lower bound of your date range with a greater than or equal to sign, i.e. 

Code: ">=4/16/2010"

Likewise, in C3, enter the upper bound of your date range with a lesser than or equal to sign, i.e. 

Code: "<=4/20/2010"

Now, highlight your data range and header (D28:D3000) and selected Advanced Filter from the Data menu.Then, in the Criteria section, enter your criteria range, i.e. B2:C3.Press OK and it will return your results.Note: Your date format is probably different than mine, as I am using the American version. Adjust accordingly.

More Questions Like This