Tab hidden/unhidden formula

Rowanhf12

New Member
Joined
Jan 22, 2016
Messages
27
Say I have tabs in excel named 1,2,3,...,10.

Is there a formula to determine which of these tabs are unhidden or hidden.
Example. Tabs 1 and 2 are open. Tabs 3 to 10 are hidden.

Tab Formula result
1 Yes
2 Yes
3 No
4 No
5 No
6 No
7 No
8 No
9 No
10 No
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
I'm not aware of a native Excel function for this, I think you'll need a UDF. If that's a possibility let me know and I'll put one together.
 
Upvote 0
If a UDF is an option here is one

Code:
Function isSheetVisible(sh As String) As String
'Test if the sheet actually exists
If Evaluate("ISREF('" & sh & "'!A1)") Then
    Select Case Sheets(sh).Visible
        'Is it visible?
        Case Is = xlSheetVisible
            isSheetVisible = "Yes - Visible"
        'Is it just normal hidden
        Case Is = xlSheetHidden
            isSheetVisible = "No - Hidden"
        'Is it very hidden
        Case Is = xlSheetVeryHidden
            isSheetVisible = "No - Very Hidden"
    End Select
Else
    'The sheet doesn't exist
    isSheetVisible = "No Sheet"
End If
End Function

Use in a sheet like so


Excel 2007
AB
1NameUDF
2Sheet1Yes - Visible
3Sheet2No - Hidden
4Sheet3No - Very Hidden
5RandomNo Sheet
Sheet1
Cell Formulas
RangeFormula
B2=isSheetVisible(A2)


You can test if a sheet exists natively, just not it's visibility.

Regards

Dave
 
Upvote 0

Forum statistics

Threads
1,223,638
Messages
6,173,492
Members
452,516
Latest member
druck21

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
Back
Top