View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
BrianB BrianB is offline
external usenet poster
 
Posts: 1
Default Saving and Closing multiple files and Excel program


Like tihs ?

Code:
--------------------

Sub SaveBooksUntested()
Dim MySave As Boolean
rsp = MsgBox("Save Non 'Book' files ?", vbYesNoCancel)
If rsp = vbCancel Then Exit Sub
If rsp = vbYes Then MySave = True
If rsp = vbYes Then MySave = False
'-----------------------------------------------------------
For Each wb In Workbooks
If wb.Name < "Book1.xls" And wb.Name < "Book2.xls" Then
wb.Close savechanges:=MySave
End If
Next
End Sub

--------------------


--
BrianB


------------------------------------------------------------------------
BrianB's Profile: http://www.excelforum.com/member.php...info&userid=55
View this thread: http://www.excelforum.com/showthread...hreadid=386951