Check if today's date is within current week or next week

justme101

Board Regular
Joined
Nov 18, 2017
Messages
67
Office Version
  1. 365
Platform
  1. Windows
Hello experts,

I have two columns L and M, which have starting date (L) and ending date (M) for certain events (format is mm/dd/yyyy). I want to write a VBA program which can filter these columns with dates, if they are from the current week or the coming week (week definition - Monday through Sunday). If we can do this using formulas in the file, like in a new column, I am OK with that as well, but I would need to incorporate that formula in the code as this process is in the middle of a really long workflow, which is being done with the help of vba. Thanks for your help.
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
One way you might do it is with a simple helper column formula. You could use VBA to put this formula in, and to filter the TRUE's.

ABCD
1
2Weeks
3CurrentMon Jul 18 2022Sun Jul 24 2022
4ComingMon Jul 25 2022Sun Jul 31 2022
5
6StartEndFilter?
7Jul 1 2022Jul 15 2022FALSE
8Jul 20 2022Jul 22 2022TRUE
9Jul 20 2022Oct 1 2022TRUE
10Jul 17 2022Jul 18 2022TRUE
11Jul 17 2022Oct 1 2022TRUE
12Jul 31 2022Jul 31 2022TRUE
13Aug 1 2022Aug 3 2022FALSE
Sheet1
Cell Formulas
RangeFormula
D7:D13D7=AND(B7<=End,C7>=Start)
Named Ranges
NameRefers ToCells
End=Sheet4!$D$4D7:D13
Start=Sheet4!$C$3D7:D13
 
Upvote 0

Forum statistics

Threads
1,214,861
Messages
6,121,973
Members
449,059
Latest member
oculus

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top