Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a macro that will close all open workbooks, works great. Now I
would like to have this macro close all open workbooks except one specific files, KeyWest.xls. The below code works and I imagine a simple IF Then sort of statement might solve my problem but I cannot figure it out. Thanks for any help! Ryan Public Sub CloseAll() Dim WB As Workbook SaveAll For Each WB In Workbooks If Not WB.Name = ThisWorkbook.Name Then WB.Close SaveChanges:=True End If Next WB ThisWorkbook.Close SaveChanges:=True End Sub --- Message posted from http://www.ExcelForum.com/ |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to close all open workbooks in Excel 2007 | Setting up and Configuration of Excel | |||
Workbooks Close, but window stays open | Excel Discussion (Misc queries) | |||
Open Close workbooks | Excel Discussion (Misc queries) | |||
help with macro to open and close workbooks | Excel Programming | |||
Can I have a loop to open a set of workbooks get some data, close it one a time. | Excel Programming |