Hello All
I have a table in which the first column contains dates.
I have to filter this first column, by choosing only the dates of the current week.
How can I program this through VBA?
thanks in advance for your help.
regards
Uma
Hello All
I have a table in which the first column contains dates.
I have to filter this first column, by choosing only the dates of the current week.
How can I program this through VBA?
thanks in advance for your help.
regards
Uma
Hi Uma,
You have posted your query in Excel formula section and asking the solution in VBA
You can have a column on the right side of your first column and use formula =weeknum(a1), where a is your first column. Now you can easily filter basis week number of current week. thanks.
Regards,
DILIPandey
<click on below * if this helps>
DILIPandey, Excel rMVP
+919810929744 (India), +971528225509 (Dubai), dilipandey@gmail.com
Sorry for posting it under wrong title.
so I need to first get the current week number in my code.
Then check, for every row, if the week number of the first column is matching with the week number tht i just calculated.
correct?
hi Uma. alternatively in Excel 2007 & above, the filter also contains a Date Filter -> This Week.
assuming data in A1:A13, code of this recorded is something like:
![]()
Please Login or Register to view this content.
Last edited by benishiryo; 12-26-2012 at 08:29 AM. Reason: additional info
Thanks, if you have clicked on the * and added our rep.
If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".
"Contentment is not the fulfillment of what you want, but the realization of what you already have."
Tips & Tutorials I Compiled | How to Get Quick & Good Answers
Yes...
or you can just consider the current cell( date ) and if date is in-between the current week.. for example if current cell 19 Dec then it is not in current week i.e., 24 Dec to 30 Dec but 26 Dec is in between the current week.
Regards,
DILIPandey
<click on below * if this helps>
I am using Excel 2010. Please help me to find this date filter.
On the data ribbon, there is a filter ICON, which i use for filter.
But where is the "date filter"?
For the current week, I need to check if the date is in between 24th and 28th Dec.
How can i get these start and end dates of the week programatically in VBA?
Hi uvaidya,
Try below code to get Week start and week end dates :-
w_start is week start![]()
Please Login or Register to view this content.
w_end is week end, as desired by you.
Regards,
DILIPandey
<click on below * if this helps>
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks