View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
dustinbrearton via OfficeKB.com dustinbrearton via OfficeKB.com is offline
external usenet poster
 
Posts: 46
Default Close almost all workbooks

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