Hello Maba,
If I understand your post, you want to check if there are any other open workbooks when you close the workbook you have open.
Sub CheckForOpenWorkbooks()
Dim Msg As String
Dim MyWkb As String
Dim N As Long
Dim Wkb As Workbook
MyWkb = ActiveWorkbook.Name
For Each Wkb In ThisWorkbook.Workbooks
If Wkb.Name <> MyWkb Then
N = N + 1
Msg = Msg & Wkb.Name & vbCrLf
End If
Next Wkb
If N <> 0 Then
MsgBox Str(N) & " Workbooks found Open." & vbCrLf & Msg
End If
End Sub
This macro will check if anyother workbooks other than yours are still open and list them in a message box.
Sincerely,
Leith Ross
Bookmarks