Count Open Unsaved Workbooks.
Sub VisibleWorkbooks()
Dim book As Workbook
Dim i As Integer
For Each book In Workbooks
If book.Saved = False Then
i = i + 1
End If
Next book
MsgBox i
End Sub
Let’s you have 5-10 open workbooks, you can use this code to get the number of workbooks which are not saved yet.