Trying to run a report using system day/date

RunTime91

Active Member
Joined
Aug 30, 2012
Messages
262
Hello All ~

I am trying to have excel run a report based on the day of the week.

I have tried eleventeenhundred iterations of:

"If Weekday(Today()) = vbWednesday Then..."

The goal here is to not reference a cell with today's date, but rather have excel use its own system day/date to recognize, upon shutting down, if today is a "Wednesday" then run this report.

Any help would be greatly appreciated.
 

Some videos you may like

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.

Drrellik

Well-known Member
Joined
Apr 29, 2013
Messages
770
Office Version
  1. 365
  2. 2016
  3. 2013
  4. 2011
  5. 2010
Platform
  1. Windows
=WEEKDAY(TODAY()) will return a value of 3. so =if(WEEKDAY(TODAY())=3,run report,don't run or nothing)

hope that helps

3= Wenesday
 

RunTime91

Active Member
Joined
Aug 30, 2012
Messages
262
=WEEKDAY(TODAY()) will return a value of 3. so =if(WEEKDAY(TODAY())=3,run report,don't run or nothing)

hope that helps

3= Wenesday

Drrellik ~ Thanks for chiming in ~

I tried and played around with different versions of the following:
Code:
If Weekday(Today()) = 3 Then
    'Run Report'
End If

but each time I get a "Subscript out of range" error


On another note,

I tried the following:
Code:
If Weekday(Now) = 3 Then
    'Run Report'
End If

And although it seems this method recognizes 4 as Wednesday it works - or at lease it appears to be working

Thoughts?
 

Drrellik

Well-known Member
Joined
Apr 29, 2013
Messages
770
Office Version
  1. 365
  2. 2016
  3. 2013
  4. 2011
  5. 2010
Platform
  1. Windows
my apologies, you are looking for some VBA for this. I was giving you a formula in an IF statement IF this = that, do this, if not do this.

I am not quite up to speed on VBA but I am learning. maybe someone else can help from here.
 

Watch MrExcel Video

Forum statistics

Threads
1,122,464
Messages
5,596,288
Members
414,052
Latest member
Dual Showman

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
Top