Count Open Unsaved Workbooks
Let’s you have 5-10 open workbooks, you can use this code to get
the number of workbooks which are not saved yet.
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
No comments:
Post a Comment