ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Varify status before runing code (https://www.excelbanter.com/excel-programming/348816-varify-status-before-runing-code.html)

Patrick Simonds

Varify status before runing code
 
Is there any way to prevent the code below from runing if the following
formula (on the active worksheet) is True WEEKDAY(C4)=7

If Union(Target, Range("A22:C25")).Address = Range("A22:C25").Address Then
EmployeeList.Show



Norman Jones

Varify status before runing code
 
Hi Patrick,

At the top of the sub, try inserting:

If Weekday(Range("C4")) = 7 Then Exit Sub

---
Regards,
Norman


"Patrick Simonds" wrote in message
...
Is there any way to prevent the code below from runing if the following
formula (on the active worksheet) is True WEEKDAY(C4)=7

If Union(Target, Range("A22:C25")).Address = Range("A22:C25").Address Then
EmployeeList.Show





All times are GMT +1. The time now is 07:32 PM.

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