Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,856
Default Resetting autofilters

I have a macro which copies formulae in row 4 down each column on
Sheet1. There is a header row in row 3 (columns A to K) and
autofilters have been set up in this row. If the User applies a filter
before running the macro (perhaps on data from an earlier run), the
formulae will not be copied down to every cell.

Is there an easy way to un-set any filters at the beginning of my
macro?

As a follow up, though this is not crucial, is it possible to read the
filter status of each column, un-set it if set, copy the formulae down
and then re-apply the same filter(s) at the end of the macro?

Thanks for any advice.

Pete
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 420
Default Resetting autofilters

If you want to remove the filter (and filter arrows):

With worksheets("Somesheetnamehere")
.autofiltermode = false
end with

If you want to just show the data, but keep the arrows:

With worksheets("Somesheetnamehere")
if .filtermode then
'some filter is applied
.showalldata
end if
end with

On 09/17/2010 19:38, Pete_UK wrote:
I have a macro which copies formulae in row 4 down each column on
Sheet1. There is a header row in row 3 (columns A to K) and
autofilters have been set up in this row. If the User applies a filter
before running the macro (perhaps on data from an earlier run), the
formulae will not be copied down to every cell.

Is there an easy way to un-set any filters at the beginning of my
macro?

As a follow up, though this is not crucial, is it possible to read the
filter status of each column, un-set it if set, copy the formulae down
and then re-apply the same filter(s) at the end of the macro?

Thanks for any advice.

Pete


--
Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,856
Default Resetting autofilters

Thanks, Dave. I'll give it a try later on.

Pete

On Sep 18, 11:13*am, Dave Peterson wrote:
If you want to remove the filter (and filter arrows):

* * *With worksheets("Somesheetnamehere")
* * * * *.autofiltermode = false
* * *end with

If you want to just show the data, but keep the arrows:

* * *With worksheets("Somesheetnamehere")
* * * * *if .filtermode then
* * * * * *'some filter is applied
* * * * * *.showalldata
* * * * *end if
* * * end with

On 09/17/2010 19:38, Pete_UK wrote:





I have a macro which copies formulae in row 4 down each column on
Sheet1. There is a header row in row 3 (columns A to K) and
autofilters have been set up in this row. If the User applies a filter
before running the macro (perhaps on data from an earlier run), the
formulae will not be copied down to every cell.


Is there an easy way to un-set any filters at the beginning of my
macro?


As a follow up, though this is not crucial, is it possible to read the
filter status of each column, un-set it if set, copy the formulae down
and then re-apply the same filter(s) at the end of the macro?


Thanks for any advice.


Pete


--
Dave Peterson- Hide quoted text -

- Show quoted text -


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
2 Autofilters N1KO Excel Programming 1 May 28th 09 03:21 PM
AutoFilters Joli Excel Worksheet Functions 1 March 21st 06 09:14 PM
How to set up AutoFilters? MS Suzanne Excel Worksheet Functions 1 June 30th 05 03:53 AM
autofilters Diego Villaseñor Fernández Excel Worksheet Functions 0 January 13th 05 11:27 PM
Userforms and autofilters - Autofilters don't seen to work with userform No Name Excel Programming 3 August 28th 03 05:42 PM


All times are GMT +1. The time now is 12:23 AM.

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"