![]() |
Macro filter based on date criteria
Hi, i need a macro that can filter range A8:G200 based on criteria in G column.
Criteria is date, and i need to filter based on today's date. If today is 19.09.2009, then the macro to filter range and to show only rows with 19.09.2009 in G column. Cand this be done? Thanks! |
Macro filter based on date criteria
Yes it can but I don't think that you need a macro to do it.
I have just set up your example and got it to work no problem. In Excel 2007 take the following actions:- 1. Click anywhere in your data then:- Data / Filter This will turn on drop down arrows (at top of data). 2. Click on the downwards facing arrow in column G and select Data Filters then Today. The above will give you what you want. Please click on Yes if my comments have been helpful to you. Thanks! "puiuluipui" wrote: Hi, i need a macro that can filter range A8:G200 based on criteria in G column. Criteria is date, and i need to filter based on today's date. If today is 19.09.2009, then the macro to filter range and to show only rows with 19.09.2009 in G column. Cand this be done? Thanks! |
Macro filter based on date criteria
Hi, the problem is that i have Excel 2003. If i can do in Excel 2003 like you
show me before with 2007, it will be great. But this is what i need. I need to filter this range based on criteria in G column. Criteria to be today, so to view only rows with today's date in G column. After i filter range, i need to copy filtered rows to another workbook. That's why i need an macro to filter. To adjust the macro to copy/paste i will do it with record, but the filter range is a little bit different. Can this be done? Thanks! "trip_to_tokyo" wrote: Yes it can but I don't think that you need a macro to do it. I have just set up your example and got it to work no problem. In Excel 2007 take the following actions:- 1. Click anywhere in your data then:- Data / Filter This will turn on drop down arrows (at top of data). 2. Click on the downwards facing arrow in column G and select Data Filters then Today. The above will give you what you want. Please click on Yes if my comments have been helpful to you. Thanks! "puiuluipui" wrote: Hi, i need a macro that can filter range A8:G200 based on criteria in G column. Criteria is date, and i need to filter based on today's date. If today is 19.09.2009, then the macro to filter range and to show only rows with 19.09.2009 in G column. Cand this be done? Thanks! |
Macro filter based on date criteria
You can record the whole macro. Turn on the macro recorder before you start
filtering your data. Turn it off after you finish your copying. You will likely have to adjust your macro slightly, and that's where this board can help. But to create the whole procedure, you're better off recording the macro yourself than asking someone else to create it for you. In order for someone else to create the code for you, they would have to know whether your cells have real dates in them, or are text. If text, then what format. The macro recorder is a much faster solution. Regards, Fred. "puiuluipui" wrote in message ... Hi, the problem is that i have Excel 2003. If i can do in Excel 2003 like you show me before with 2007, it will be great. But this is what i need. I need to filter this range based on criteria in G column. Criteria to be today, so to view only rows with today's date in G column. After i filter range, i need to copy filtered rows to another workbook. That's why i need an macro to filter. To adjust the macro to copy/paste i will do it with record, but the filter range is a little bit different. Can this be done? Thanks! "trip_to_tokyo" wrote: Yes it can but I don't think that you need a macro to do it. I have just set up your example and got it to work no problem. In Excel 2007 take the following actions:- 1. Click anywhere in your data then:- Data / Filter This will turn on drop down arrows (at top of data). 2. Click on the downwards facing arrow in column G and select Data Filters then Today. The above will give you what you want. Please click on Yes if my comments have been helpful to you. Thanks! "puiuluipui" wrote: Hi, i need a macro that can filter range A8:G200 based on criteria in G column. Criteria is date, and i need to filter based on today's date. If today is 19.09.2009, then the macro to filter range and to show only rows with 19.09.2009 in G column. Cand this be done? Thanks! |
Macro filter based on date criteria
This is a duplicate posting. I've been working the problem for a couple of
days. I think the issue is the dates may be a combination of US and English dates. See posting http://www.microsoft.com/office/comm...6-848f9223a2d1 "puiuluipui" wrote: Hi, the problem is that i have Excel 2003. If i can do in Excel 2003 like you show me before with 2007, it will be great. But this is what i need. I need to filter this range based on criteria in G column. Criteria to be today, so to view only rows with today's date in G column. After i filter range, i need to copy filtered rows to another workbook. That's why i need an macro to filter. To adjust the macro to copy/paste i will do it with record, but the filter range is a little bit different. Can this be done? Thanks! "trip_to_tokyo" wrote: Yes it can but I don't think that you need a macro to do it. I have just set up your example and got it to work no problem. In Excel 2007 take the following actions:- 1. Click anywhere in your data then:- Data / Filter This will turn on drop down arrows (at top of data). 2. Click on the downwards facing arrow in column G and select Data Filters then Today. The above will give you what you want. Please click on Yes if my comments have been helpful to you. Thanks! "puiuluipui" wrote: Hi, i need a macro that can filter range A8:G200 based on criteria in G column. Criteria is date, and i need to filter based on today's date. If today is 19.09.2009, then the macro to filter range and to show only rows with 19.09.2009 in G column. Cand this be done? Thanks! |
All times are GMT +1. The time now is 10:05 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com