Show TRUE in a cell if sheet is hidden

nutrastat

Board Regular
Joined
Nov 1, 2008
Messages
57
Using a formula the sheet/tab names are displayed in a cell; say D4 . In this way, when we change the name on the tab, it will change the name in the cell, and we reference everything off this cell name.

We now wish to have to the right of the cell name (i.e. D5) a cell that will show either TRUE or FALSE if the sheet is hidden (i.e. if the sheet is hidden then the cell will show TRUE).

What formula can we use to test if a sheet is hidden or not, and, just to complicate the issue it should cope with the ability of this sheet to have a name change, and should use the cell reference D4.

Can anyone help please?
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
For this sheet:

Excel Workbook
AB
1NameHidden?
2Sheet1FALSE
3Sheet2FALSE
4Sheet3TRUE
5Sheet4FALSE
6Sheet5FALSE
Index


I use this code (in the Worksheet code -- Right Click the worksheet name, and paste this):
Code:
Option Explicit

Private Sub Worksheet_Calculate()
    Dim i As Integer
    
    For i = 2 To Range("A1").End(xlDown).Row
        If Worksheets(Cells(i, 1).Value).Visible = True Then
            Cells(i, 2).Value = "FALSE"
        Else
            Cells(i, 2).Value = "TRUE"
        End If
    Next i

End Sub
 
Upvote 0
I have been away working on another project, and therefore ask you to forgive the delay in THANKING you for your answer. Works perfectly!!
 
Upvote 0

Forum statistics

Threads
1,214,392
Messages
6,119,255
Members
448,879
Latest member
oksanana

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