Check if any hidden rows or columns

Tested in Excel 2016 (16.0.9330.2073) 64-bit

You can check with something like this:

 
 
  1. Public Function CheckIfAnyHiddenColOrRow(SheetToCheck As String, Optional RowOrCol = "Row") As Boolean
  2.     Dim test As Boolean
  3.     Dim i
  4.     test = False
  5.     If LCase(RowOrCol) = "row" Then
  6.         For i = 1 To Rows.Count
  7.             If Rows(i).Hidden Then
  8.                 test = True
  9.                 Exit For
  10.             End If
  11.         Next i
  12.     Else
  13.         For i = 1 To Columns.Count
  14.             If Columns(i).Hidden Then
  15.                 test = True
  16.                 Exit For
  17.             End If
  18.         Next i
  19.     End If
  20.     CheckIfAnyHiddenCol = test
  21. End Function

Or just unhide all:

 
 
  1. Sub UnhideAllColsAndRows()
  2.     Cells.Select
  3.     Selection.EntireColumn.Hidden = False
  4.     Selection.EntireRow.Hidden = False
  5. End Sub

Add a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.