I have written code to close several workbooks, which is shown below
The code closes all the workbooks except the the workbooks named Volvo. The full names are volvo_Service_Sales and Volvo_parts_sales
It would be appreciated if you could assist
Sub close_Files()
For Each wb In Workbooks
If wb.Name Like "*93_94.xls" Then wb.Close True
For Each wb1 In Workbooks
If wb1.Name Like "volvo*" Then wb1.Close True
For Each wb2 In Workbooks
If wb2.Name Like "Niss*" Then wb2.Close True
For Each wb3 In Workbooks
If wb3.Name Like "Volpe*" Then wb3.Close True
Next
Next
Next
Next
End Sub
The code closes all the workbooks except the the workbooks named Volvo. The full names are volvo_Service_Sales and Volvo_parts_sales
It would be appreciated if you could assist
Sub close_Files()
For Each wb In Workbooks
If wb.Name Like "*93_94.xls" Then wb.Close True
For Each wb1 In Workbooks
If wb1.Name Like "volvo*" Then wb1.Close True
For Each wb2 In Workbooks
If wb2.Name Like "Niss*" Then wb2.Close True
For Each wb3 In Workbooks
If wb3.Name Like "Volpe*" Then wb3.Close True
Next
Next
Next
Next
End Sub