I have a macro to close all files containing "Sales Incentives" in the name of the workbook eg BR1 Sales Incentives (Pin).xlsm, Southern Sales incentives(Pin).xlsm etc except for the active workbook
However, these files are being closed
It would be appreciated if someone could kindly amend my code
However, these files are being closed
Code:
Sub Close_Incentive_Workbooks()
Dim wb As Workbook
For Each wb In Application.Workbooks
If wb.Name Like "*Sales Incentives.xlsm*" Then
If Not (wb Is ActiveWorkbook) Then wb.Close SaveChanges:=True
End If
Next wb
End Sub
It would be appreciated if someone could kindly amend my code