ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Getting a macro to perform a function on a certain day every week. (https://www.excelbanter.com/excel-programming/304384-getting-macro-perform-function-certain-day-every-week.html)

Ian M[_2_]

Getting a macro to perform a function on a certain day every week.
 
I run a macro daily in an Excel Workbook to produce certain data.

However, every Tuesday I have to get the macro to perform an extra
task which I do not require it to perform on any other day say, for
example, for a message box to appear saying "Produce the Tuesday
Report".

How can I write an extra clause so that if I run the macro on a
Tuesday the message box will appear, but if I run the macro on any
other day, it will not.

Tom Ogilvy

Getting a macro to perform a function on a certain day every week.
 
if weekday(date,vbSunday) = 3 then
msgbox "It's Tuesday"
End if

--
Regards,
Tom Ogilvy


"Ian M" wrote in message
om...
I run a macro daily in an Excel Workbook to produce certain data.

However, every Tuesday I have to get the macro to perform an extra
task which I do not require it to perform on any other day say, for
example, for a message box to appear saying "Produce the Tuesday
Report".

How can I write an extra clause so that if I run the macro on a
Tuesday the message box will appear, but if I run the macro on any
other day, it will not.




Vasant Nanavati

Getting a macro to perform a function on a certain day every week.
 
If Weekday(Date, vbSunday) = 3 Then MsgBox "Produce the Tuesday Report."

--

Vasant

"Ian M" wrote in message
om...
I run a macro daily in an Excel Workbook to produce certain data.

However, every Tuesday I have to get the macro to perform an extra
task which I do not require it to perform on any other day say, for
example, for a message box to appear saying "Produce the Tuesday
Report".

How can I write an extra clause so that if I run the macro on a
Tuesday the message box will appear, but if I run the macro on any
other day, it will not.





All times are GMT +1. The time now is 04:19 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com