Counting hidden workbooks

tactps

Well-known Member
Joined
Jan 20, 2004
Messages
3,460
I have a macro in a shared workbook that is run by a number of people at different times. Some of the users have hidden workboooks (eg I have "personal" hidden) whilst other dont.

What is the syntax to count the number of hidden workbooks?

(eg something like activeworkbooks.hidden.count?????)
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney

SIXTH SENSE

Well-known Member
Joined
Oct 29, 2003
Messages
1,883
tactps said:
I have a macro in a shared workbook that is run by a number of people at different times. Some of the users have hidden workboooks (eg I have "personal" hidden) whilst other dont.

What is the syntax to count the number of hidden workbooks?

(eg something like activeworkbooks.hidden.count?????)
Hi!
Did you mean hidden workbooks or hidden worksheets?
 

tactps

Well-known Member
Joined
Jan 20, 2004
Messages
3,460
Hidden workbooks.

For example, I have "personal.xls" in my xlstart menu, but I have hidden it so that Book1 will be visible when I open Excel.

However, other users do not have hidden workbooks, so I would like to count the number of hidden workbooks to adjust the number in my macro.
 

Ivan F Moala

MrExcel MVP
Joined
Feb 10, 2002
Messages
4,209
Your'll have to loop through the Windows objects and test if hidden (visible) or not eg

Code:
Sub Tester()
Dim x As Integer
Dim Wb As Window

For Each Wb In Windows
    If Wb.Visible <> True Then
        x = x + 1
    End If
Next

MsgBox x & " hidden Window(s)"

End Sub
 

Forum statistics

Threads
1,171,631
Messages
5,876,556
Members
433,200
Latest member
CoolBlue_

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top