Hi everyone,
I found something quite weird:
On a filtered table (where a lot of rows are hidden due to the filters), I refer to a cell using tablerange.SpecialCells(XlCellTypeVisible).Cells(3,1) (where I set my tablerange as .ListObjects("TableName").DataBodyRange)
I thought it would logically refer to the third visible row on my filtered table.
As it turns out, when referring to XlCellTypeVisible, it seems that only the first hidden cells are correctly taken out.
If my table is filtered in such a way that only the following row numbers are visible (3,4,6 which means my rows 2 and 5 are hidden), referring to tablerange.SpecialCells(XlCellTypeVisible).Cells(1,1) correctly returns the cell in row 3 (the first visible cell); whereas referring to tablerange.SpecialCells(XlCellTypeVisible).Cells(3,1) returns the cell in row 5 (a hidden row!).
It seems to me that XlCellTypeVisible only takes into account the first visible cell it sees and then starts from there.
Anyone could enlighten me on the workings of that method?
Thanks in advance!
I found something quite weird:
On a filtered table (where a lot of rows are hidden due to the filters), I refer to a cell using tablerange.SpecialCells(XlCellTypeVisible).Cells(3,1) (where I set my tablerange as .ListObjects("TableName").DataBodyRange)
I thought it would logically refer to the third visible row on my filtered table.
As it turns out, when referring to XlCellTypeVisible, it seems that only the first hidden cells are correctly taken out.
If my table is filtered in such a way that only the following row numbers are visible (3,4,6 which means my rows 2 and 5 are hidden), referring to tablerange.SpecialCells(XlCellTypeVisible).Cells(1,1) correctly returns the cell in row 3 (the first visible cell); whereas referring to tablerange.SpecialCells(XlCellTypeVisible).Cells(3,1) returns the cell in row 5 (a hidden row!).
It seems to me that XlCellTypeVisible only takes into account the first visible cell it sees and then starts from there.
Anyone could enlighten me on the workings of that method?
Thanks in advance!