Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
ALV ALV is offline
external usenet poster
 
Posts: 12
Default Turn filters off and back on

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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
  #3   Report Post  
Posted to microsoft.public.excel.programming
ALV ALV is offline
external usenet poster
 
Posts: 12
Default Turn filters off and back on

Thanks Simon.

My app is a C# add-in for Excel 2007. The only Selection object I can find
is Application.Selection and it doesn't have an AutoFilter method.

Could you send the namespace for the Selection object you are referring to?

"Simon Lloyd" wrote:


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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Turn filters on in multiple sheets EstherJ Excel Programming 6 September 29th 08 12:57 PM
How do i turn the merge cell option back on? neecee48 Excel Discussion (Misc queries) 1 March 11th 08 08:44 PM
turn an filter off or back to All Dennis Excel Programming 1 November 9th 06 08:22 AM
Turn Filters On and Off Phil H[_2_] Excel Programming 2 September 18th 06 01:30 PM
Turn ON Autofilter Filters dcHill Excel Programming 1 June 16th 05 07:53 PM


All times are GMT +1. The time now is 10:52 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"