Cell Which Tells You If Coulmns Are Hidden

burdie87

Board Regular
Joined
May 25, 2005
Messages
152
Hi,
I am looking for a solution to the following problem.

I need a cell that will say if coulmns in the worksheet are hidden or not but im not sure about how to do it, if it is at all possible.

Alan.
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
You could try this UDF:

Code:
Function ColsHidden() As Boolean
    Dim c As Integer
    Application.Volatile True
    With Application.Caller.Parent
        For c = 1 To .Columns.Count
            If .Columns(c).EntireColumn.Hidden = True Then
                ColsHidden = True
                Exit Function
            End If
        Next c
    End With
End Function

Put it in a cell like this:

=ColsHidden()

Note that it won't update automatically when you hide/unhide columns. But it will update if the worksheet is recalculated or you press F9
 
Upvote 0
Hey,
I am quite simple but where do i put the above code to make it woprk cause all i get is name#.
Alan
 
Upvote 0
In your workbook press Alt+F11 to go to the Visual Basic Editor. Click your workbook in the Project window and choose Insert|Module from the menu. Paste my code into the window on the right. Press Alt+F11 again to return to your workbook.
 
Upvote 0
Here's another way which is not exactly what you requested but which might be useful since it will update automatically when columns are hidden/unhidden.

Select row 1 and put the following formula in ConditionalFormatting :-

=CELL("Width",B1)=0

Your format of choice will appear in any cell in row 1 immediately preceding a hidden column (except, of course, in the case of column A being hidden).
 
Upvote 0

Forum statistics

Threads
1,214,649
Messages
6,120,728
Members
448,987
Latest member
marion_davis

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