Hi I need to filter a worksheet if the date dd/mm/yy in column 5 is =today()-182
Until now I've been ok filtering by strings etc but...
![]()
Please Login or Register to view this content.
Hi I need to filter a worksheet if the date dd/mm/yy in column 5 is =today()-182
Until now I've been ok filtering by strings etc but...
![]()
Please Login or Register to view this content.
Last edited by KAPearson; 05-25-2012 at 02:26 PM.
Hi,
Are you wanting 2 filters set?
One by the "Dept"
One by the "Date"
A little mode detail and if possible a redacted copy of your workbook.
Charles
There are other ways to do this, this is but 1 !
Be Sure you thank those who helped.
IF YOU'RE SATISFIED BY ANY MEMBERS RESPONSE TO YOUR ISSUE PLEASE USE THE STAR ICON AT THE BOTTOM LEFT OF THE POST UNDER THEIR NAME.
Hi I would like to filter my main sheet based on if the date in column 5 is = to todays date - 182 days.
At the mlment i usewhich allows me to filter the sheet by a string but i cant seem to get filter by =today()-182.![]()
Please Login or Register to view this content.
I need to filter in place then copy to a ne sheet. Any ideas?
Hi,
Not tested but try
![]()
Please Login or Register to view this content.
Thanks but it dosnt filter any results must be something about how i'm formating the date
Hi,
try
![]()
Please Login or Register to view this content.
No sorry nothing - I know how frustrating this believe me![]()
hi,
Could you post a copy of the workbook?
sure thanks give me a sec to unpassword it etc
Here you go charles, Just click tab "Menu2" then bakery to see it happily filtering by "Bakery"Tracker.zip
Ok sorry about that trying to slim it down
Good luck
Sorry Charles I just relised there may not be a date under the orange column with a date over 182 old so you may need to change it before 01/11/11 say
hi,
Which module is the code in?
sheet 3 (menu2)
hi,
Ok, I do not think you can do what you want. What you need to do is once the filter is set in column 3 you need to loop thru the visible rang and see if the date in column is => than the date range specified.
If it => then copy the data.
Thanks anyway at least I'm not going mad!
hi,
I'll see if I can come up with something. Unless someone else provide you with the solution.
Hi,
If you have a date that you are looking for what do you want to copy? In your code you have the entire column being copied.
Do you just want the "Person" data copied to another sheet?
In the workbook you sent I see 2 dates that are <= todays date -182.
Hi I need to filter the think 25 column for any dates that are older than today-182 and copy those dates to main2. If I can find that then the other colums will be similar but 182 or 360 days. Once I work out how to filter =today()-182 from vba its plain sailing (hopefuly)
Hi,
As mentioned. I do not think you can set a filter for the date you require. You can how ever code the filtered data for "Bakery" and check the visible rows/columns to see if any date is less than or equal to your criteria. I have code that will do this. It can be expanded to look in all of the visible rows/columns. Once it sees the criteria copy the data to the desired sheet for each occurrence of the Date.
If the date only shows in 1 column the that row/all columns will be copied to the destination sheet.
Is this what you want?
lmk
Last edited by Charles; 05-26-2012 at 08:32 PM.
bump to top
OK,
I code this to loop thru the filtered rang for the specified criteria.
If in the column 5 all date are ok it will go to the next column to validate the date. If it finds a date that meets the criteria it will then copy that row to the desired sheet.
For testing I have an "Exit Sub" that will keep the rest of your code from running. You can remove it if you want.
Now if you want the same situation for each category for "Dept" you can set the code so that it will filter Each department.
Hope this helps.
Brilliant Charles thenks very much for your help. This will solve a couple of problems.
Hi,
Thanks for letting me know. And, too thanks for the "Rep"
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks