Count the Number of Open Excel Workbooks
- 0 Comments
This may be the shortest post on Excel Hints to date. There are many times when you are working on your project that you may need to know the number of open workbooks open on your desktop. There is a simple way you can use a built-in Excel feature to have it do the counting for you. Take a look at the example below:
Sub CountWorkbooks()
Msgbox(Windows.Count)
End Sub
The result of running this macro will be a message box showing the count of currently open workbooks. The bulk of work in this example is done by the simple line: Windows.Count.

