Turn filters off and back on
ALV;7180574 Wrote:
I'm trying to write a large array to a range on a sheet next to another
range
that may have filtered rows.
I'm doing this:
rng.Cells.set_Value(Type.Missing, (object)arrValues);
arrValues is a 2-dimensional array with nulls on the filtered rows
(because
it is derived from the range it is being pasted next to).
When there are no filtered or hidden rows in the adjacent range, this
is
fast and works fine.
But when rows are filtered, the data I write gets scrambled and
repeated
after the first filtered row.
Does anyone know if there is a way to turn the filter off before
writing and
then turn it back on after?
Thanks.
This line
Code:
--------------------
Selection.AutoFilter
--------------------
you can use before and after, experiment with it in different places in
your code to find the optimum time to turn the filter on and off!
Regards,
SImon
--
Simon Lloyd
|