Filtered Cells

  • Thread starter Thread starter Abelardo Vacca
  • Start date Start date
A

Abelardo Vacca

Hello,
I'm doing an Excel Macro and I need to know if there is a
way of see the difference between filtered (not visible)
cells and the nonfiltered (visible) cells within a Range.
I'm scanning the Range to do a task on each cell, but i
need to ignore the non visible cells.

Thanks a lot
 
Abelardo,

Here is some code I wrote to handle filtered data which may get you started.
Note: The IF test handles situations where there is a null selection (except
for the header row).

Range("A1").AutoFilter Field:=3, Criteria1:="<>"
Range("C1:C" & lLastRow).SpecialCells(xlCellTypeVisible).Select
If Selection.Rows.Count > 1 Or Selection.Areas.Count > 1 Then
For Each rngCell In Range("H2:H" &
lLastRow).SpecialCells(xlCellTypeVisible)
rngCell.Value = "Whatever"
Next rngCell
End If

regards,

JohnI
 
If YourCell.EntireRow.Hidden = True Then ' the cell's visible
' ....
Else ' the cell's hidden
' .....
End If

HTH,
Jouni
 
Back
Top