O
Otto Moehrbach
Excel XP & Win XP
I have headers in row 2.
I have data in row 3 only, therefore, RngToCopy is B3. This is correct.
I invoke an Auto-Filter on the data and, as a result, there are NO visible
rows (below the header row).
I have the following 2 message boxes:
MsgBox RngToCopy.Address(0, 0)
MsgBox RngToCopy.SpecialCells(xlCellTypeVisible).Count
The first MsgBox gives B3. Correct.
The second MsgBox gives 16776960 which is very close to the number of cells
in the sheet!!.
Since B3 is the RngToCopy and B3 is hidden (by filter), I expected the
second MsgBox to give a zero.
How can I get the count of visible cells in a range if all the cells in the
range are hidden?
Or, to put it another way, how can I determine that no rows satisfied the
filter criteria?
Thanks for your time. Otto
I have headers in row 2.
I have data in row 3 only, therefore, RngToCopy is B3. This is correct.
I invoke an Auto-Filter on the data and, as a result, there are NO visible
rows (below the header row).
I have the following 2 message boxes:
MsgBox RngToCopy.Address(0, 0)
MsgBox RngToCopy.SpecialCells(xlCellTypeVisible).Count
The first MsgBox gives B3. Correct.
The second MsgBox gives 16776960 which is very close to the number of cells
in the sheet!!.
Since B3 is the RngToCopy and B3 is hidden (by filter), I expected the
second MsgBox to give a zero.
How can I get the count of visible cells in a range if all the cells in the
range are hidden?
Or, to put it another way, how can I determine that no rows satisfied the
filter criteria?
Thanks for your time. Otto