I have written the following code to close all workbooks that are not named in the code. However, the code tries to close the specified workbook as well. D'Oh!
I think I'm on the right track, but could use a helping hand.
Thanks
In the immortal words of Socrates, who said:
"I drank what?
I think I'm on the right track, but could use a helping hand.
Code:
Sub CloseAllOthers()
Dim wb As Workbook
Dim wbName As String
For Each wb In Application.Workbooks
If wbName = "2008 Census (HB 2002) Conversion" Then
Exit Sub
Else
Workbooks.Close
End If
Next
End Sub
Thanks
In the immortal words of Socrates, who said:
"I drank what?