Saturday, September 24, 2011

Find Hidden Row Number In a Worksheet

If you want to know the row numbers which are hidden in a range.

Here is the code-

Sub find_hidden_row_numbers()
Dim a As Range, b As Range, cell As Range
Dim bla As Boolean
Dim mscl As String

' USE ONLY 1 col LIKE A1:a500 OR z1 :Z500 ... NOT LIKE (A1:Z35)
Set b = Range("a1:a500").SpecialCells(xlCellTypeVisible)
For Each cell In Range("a1:a500")
bla = False
For Each a In b
If cell.Row = a.Row Then
bla = True
Exit For
End If
Next a
If bla = False Then
msgcl = cell.Row
MsgBox "Row No -------> " & msgcl & " is Hidden"
End If
Next cell
End Sub

No comments:

Post a Comment

Import data from SQL

Macro to import data from SQL using ADO connection string: Sub Import_data_from_SQL() ' Tools -> References -> Microsoft Active...