
07-22-2010, 02:15 AM
|
|
Newcomer
|
|
Join Date: Jul 2008
Posts: 22
|
|
Filter / Range question
|
I have a table with few columns and lots of rows, which I filter by one field. This field can contain up to three kinds of values, say A, B and C, and after each filtering I need to copy the filtered data into another sheet and work on it there.
The problem comes when when there's no data corresponding to C value (there's no C value in the table). So the filtering process returns only the table header, which is fine, but I have no ideea of how to tell the compiler that there's no more data to select. The copy method selects all the cells in the sheet (the table header and ALL the blank cells) and then I paste them in the new sheet. When I do that, the scroll bar shrinks to its limits and the Ctrl+End shortcut, which initially was placing the cursor on the last cell of the table, now places it on the 'Cells(1048576, X)', and unfortunately this is not acceptable.
The question is how to avoid this situation? How can I figure out if the filtering returned rows or not? The Range("A1").End(xlDown).Row and Offset(x,y) commands are useless, since I navigate through filtered (basically hidden) cells.
|
|