ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Filtered Cells (https://www.excelbanter.com/excel-programming/277578-filtered-cells.html)

Abelardo Vacca

Filtered Cells
 
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

JohnI in Brisbane

Filtered Cells
 
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

"Abelardo Vacca" wrote in message
...
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




Jouni

Filtered Cells
 

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

HTH,
Jouni

"Abelardo Vacca" wrote in message
...
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





All times are GMT +1. The time now is 05:17 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com