ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Advance filter to find date wise? (https://www.excelbanter.com/excel-programming/348932-advance-filter-find-date-wise.html)

Tiya

Advance filter to find date wise?
 
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

Bob Phillips[_6_]

Advance filter to find date wise?
 
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)


"Tiya" wrote in message
...
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





All times are GMT +1. The time now is 11:04 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com