ابدأ بالتواصل مع الأشخاص وتبادل معارفك المهنية

أنشئ حسابًا أو سجّل الدخول للانضمام إلى مجتمعك المهني.

متابعة

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
تم إضافة السؤال من قبل kadrleyn kadr leyn , engineer , www.merkez-ihayat.com
تاريخ النشر: 2017/08/08
Firas Shahadi
من قبل Firas Shahadi , Training And Development Director , Muhayal Assir National Hospital

One way that you use the worksheet function in VBA

Application.WorksheetFuncdtions.DateDif()

Varsha Pereira
من قبل Varsha Pereira , Executive assistant to the CEO , CK Architecture Interiors

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.

المزيد من الأسئلة المماثلة

هل تحتاج لمساعدة في كتابة سيرة ذاتية تحتوي على الكلمات الدلالية التي يبحث عنها أصحاب العمل؟