Hello Love Candle,
Copy this code into a VBA module. You can call the macro anytime, and
anywhere you need in your code.
Code:
--------------------
Public Sub CloseAllWorkbooks()
Dim Wkb As Workbook
For Each Wkb In Workbooks
If Wkb.Name < ThisWorkbook.Name Then
Wkb.Saved = True
Wkb.Close
End If
Next Wkb
With ThisWorkbook
.Saved = True
.Close
End With
End Sub
--------------------
Sincerely,
Leith Ross
--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile:
http://www.excelforum.com/member.php...o&userid=18465
View this thread:
http://www.excelforum.com/showthread...hreadid=555457