Advance filter to find date wise?

G

Guest

Wish u all a happy x'mas
Hi
I am using Advance Filter for data like...
Date,PartyName,Item,Gross,Mel,Labr.

Sub test()

Sheets("DATA").Select

Range("A5:J600").AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=Range( _
"A1:J2"), CopyToRange:=Range("M5:v5"), Unique:=False


Range("M5:V5").Select
Range(Selection, Selection.End(xlDown)).Select
Range("M5:V30").Select
Selection.Copy
Sheets("Day Report").Select
ActiveSheet.Paste
Range("A2").Select
Sheets("data").Select
Range("A6").Select

End Sub

Where i want to find data list for Date wise like
Date start from 1 oct 05 to 30 oct 05 or so on.
but i am not able to do this. I have record this macro.

Any Help.

thanks

Tiya
 
B

Bob Phillips

Tiya,

Instead of using the data as a range, create a new criteria range of say

L1: Date
L2: =">="&DATE(2005,10,1)
L3: "=<="&DATE(2005,10,30)

and then use code of

Range("A5:J600").AdvancedFilter _
Action:=xlFilterCopy, _
CriteriaRange:=Range("J1:J3"), _
CopyToRange:=Range("M5:V5"), _
Unique:=False


--

HTH

RP
(remove nothere from the email address if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top