+ Reply to Thread
Results 1 to 10 of 10

Extract Data based on Date Criteria

  1. #1
    Forum Contributor
    Join Date
    11-12-2012
    Location
    Jeddah, Saudi Arabia
    MS-Off Ver
    2010, 2013, 2016, Office 365
    Posts
    507

    Extract Data based on Date Criteria

    Hi,

    I have a Summary sheet from which I need to extract the data based on date criteria and paste values in Search Sheet.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Cool Hi, try this !


    According to your attachment a starter Excel basics VBA demonstration to paste only to Sheet3 (Search) worksheet module :

    PHP Code: 
    Sub Demo1()
        [
    Y1:Z2] = Evaluate("{""Date"",""Date"";"">=" & [B1].Value2 """,""<=" & [B2].Value2 """}")
        
    Sheet2.UsedRange.Offset(Sheet2.UsedRange.Row).AdvancedFilter 2, [Y1:Z2], [A4:J4]
    End Sub 
    ► Do you like it ? ► So thanks to click on bottom left star icon « Add Reputation » !

  3. #3
    Forum Contributor
    Join Date
    11-12-2012
    Location
    Jeddah, Saudi Arabia
    MS-Off Ver
    2010, 2013, 2016, Office 365
    Posts
    507

    Re: Hi, try this !

    Thanks, but I am getting the error "The extract range has a missing or invalid field name" in the below line

    Please Login or Register  to view this content.

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,308

    Re: Hi, try this !

    Have you changed column headings as macro is looking for heading of "Date"; works fine on your posted file.
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  5. #5
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow Re: Extract Data based on Date Criteria


    As I wrote : « according to your attachment » …

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,573

    Re: Extract Data based on Date Criteria

    Barieq,

    try
    Please Login or Register  to view this content.
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    11-12-2012
    Location
    Jeddah, Saudi Arabia
    MS-Off Ver
    2010, 2013, 2016, Office 365
    Posts
    507

    Re: Extract Data based on Date Criteria

    @Marc L,

    I have tried running your code according to my attachment, but gives me the same error. Anyway thanks the thread is solved by Jindon

  8. #8
    Forum Contributor
    Join Date
    11-12-2012
    Location
    Jeddah, Saudi Arabia
    MS-Off Ver
    2010, 2013, 2016, Office 365
    Posts
    507

    Re: Extract Data based on Date Criteria

    @Jindon,

    Thanks, your code works perfectly. Solved..

  9. #9
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: Extract Data based on Date Criteria


    Something weird on your side as it works on ours …

  10. #10
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Lightbulb Or this ...


    According to your attachment a simplified variation still only into Sheet3 (Search) worksheet module :

    PHP Code: 
    Sub Demo2()
        
    With Sheet2
            
    .[B2].Formula "=(B8>=" & [B1].Value2 ")*(B8<=" & [B2].Value2 ")"
            
    .Range("A7", .Cells(.Rows.Count2).End(xlUp)(19)).AdvancedFilter 2, .[B1:B2], [A4:J4]
        
    End With
    End Sub 
    ► Do you like it ? ► So thanks to click on bottom left star icon « Add Reputation » !

+ 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. [SOLVED] Extract information based on multiple criteria and also date range
    By Punnam in forum Excel General
    Replies: 2
    Last Post: 05-20-2020, 09:51 AM
  2. [SOLVED] Extract Data based on criteria
    By Howardc1001 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-13-2020, 12:57 PM
  3. Formula to extract Data fields based on given date and other criteria
    By harishkumarn in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 02-22-2019, 06:40 AM
  4. [SOLVED] if formula based on several criteria to extract data based on conditions
    By JEAN1972 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-17-2018, 12:46 PM
  5. Replies: 0
    Last Post: 05-02-2016, 07:59 AM
  6. Replies: 3
    Last Post: 12-18-2014, 10:27 AM
  7. Extract data based on criteria
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-15-2014, 05:23 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