• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Data extraction

Villalobos

Active Member
Hello,

Previuosly the number format of column Material (sheet Data) was text, some minutes ago I could changed the format to number and now I can not extract the data (to sheet Report), please, could somebody explain me what is the reason of this?

Module1:

Code:
 Option Explicit
Sub Data_extraction()
Dim LstRw As Long, rng As Range, List As Object
    
    Sheets("Report").Select
    Range("B15").Select
    Range(Selection, Selection.End(xlToRight)).Select
    Range(Selection, Selection.End(xlDown)).Select
    Selection.Clear
    Range("B15").CurrentRegion.ClearContents
    
    Sheets("Data").Range("Table1[#All]").AdvancedFilter Action:=xlFilterCopy, CriteriaRange:= _
        Sheets("Data").Range("P12:W13"), CopyToRange:=Sheets("Report").Range("B15"), Unique:=True
    Range("B15").Select
    
   
End Sub

Module2

Code:
 Option Explicit
Sub AdvFil()
    [B15].CurrentRegion.ClearContents
    Sheets("Data").Range("Table1[#All]").AdvancedFilter 2, Range("Conditions"), [B15]
End Sub
 

Attachments

  • Data extraction problem.xlsm
    23.9 KB · Views: 8
Hi, Villalobos!
Your timestamp at column M isn't numeric, it's text, so despite of the format what matters is the content.
Regards!
 
Hi ,

The most important point to note in Advanced Filters is that the headers in the criteria range should match the headers of your data table.

Thus headers like Start date and End date will not work.

Narayan
 
Hi,

Sorry for the late answer.
I tested your solution and I can not extract the date based on unique criteria, is it right?
 
Back
Top