drewcarpenter2001
New Member
- Joined
- Dec 7, 2021
- Messages
- 4
- Office Version
- 365
- Platform
- Windows
I have the following code to call either of two macros for each looped workbook based on whether the individual workbooks contain a tab called "Summary", which is an upstream system default for certain of the files. The logical expression for the first call does not seem to be functioning - it is bypassing and running the second macro for all workbooks. Help please!
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
If ws.Name = "Summary" Then
Call Finance_Close_Summary
Else
Call Finance_NonSummary
End If
Next ws
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
If ws.Name = "Summary" Then
Call Finance_Close_Summary
Else
Call Finance_NonSummary
End If
Next ws