(Solved) – Obtaining visible data from filtered table

(solved)-–-obtaining-visible-data-from-filtered-table

I need to filter out some data from long excel table object. I extracted a single table object from Worksheets.ListObjects and filtered it out like that:

    tbl.Range.AutoFilter Field:=5, Criteria1:="Foo"
    tbl.Range.AutoFilter Field:=8, Criteria1:="Bar"

The table on the Excel’s worksheet is now displayed as filtered correctly, but if I try to access it’s data, the whole scope is returned. For example this function

tbl.Range.SpecialCells(xlCellTypeVisible).Cells(2, 1) 

returns the cell from the first row of table instead of the first visible row.

Leave a Reply

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