Jun 18 2009

Count the Number of Open Excel Workbooks

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()


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.

Random Posts

Did you find this post helpful? Try signing up for our free daily tips.

Enter your email address: 


Comments are closed.

Sign Up for Excel Hints

Free updates with Excel Hints, Tips & Tricks