Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try this code
Sub CloseWorkbooks() Dim WB As Workbook For Each WB In Application.Workbooks If WB.Name < "A.xls" Then If WB.Name = "D.xls" Then WB.Close SaveChanges:=True Else WB.Close SaveChanges:=False End If End If Next WB End Sub ChrisP wrote: Thanks! One more question, workbooks B & C I don't want to save but D I do. How would I write that? Thanks again! Chris Hi Chris [quoted text clipped - 27 lines] Thanks, Chris -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...mming/200808/1 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Workbooks.Close | Excel Programming | |||
workbooks close before | Excel Programming | |||
How to close All Workbooks | Excel Programming | |||
why do all excel worksheets/workbooks close when I close one? | Excel Discussion (Misc queries) | |||
close all other workbooks | Excel Programming |