LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Autofilter more than 1 worksheet

I have a workbook that contains 4 worksheets, all with lots of data on them.
All have autofilter set up and what I am hoping to achieve is to set the
criteria on 1 worksheet in the first column (say in cell B1) that will then
become the default criteria on all the other worksheets.

I found the following code through google but can't get it to work - I
assume the first macro can be pasted into a module but I'm not sure what to
do with the second bit.

OR is there an easier way

Thanks in advance for any help

Private Sub Worksheet_Calculate() MsgBox
ActiveSheet.AutoFilter.Filters(1).Criteria1
End Sub

'Having tht criteria, it can then be applied to any other filter in any
other sheet.
'CODE
set wsThis = Activesheet
for each ws in worksheets if ws.name < wsThis.name
then ws.autofilter.filter(1).criteria =
right(wsthis.autofilter.filter(1).criteria,len(wst his.autofilter.filter(1).criteria)-1
) end if
next


 
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
AUTOFILTER IN A PROTECTED WORKSHEET William Excel Discussion (Misc queries) 1 August 22nd 08 10:27 PM
autofilter into another worksheet [email protected] Excel Discussion (Misc queries) 1 July 27th 07 04:16 PM
autofilter and worksheet protection dreamz[_38_] Excel Programming 7 April 24th 06 08:17 PM
Using Autofilter on a Protected Worksheet Brendan Vassallo Excel Discussion (Misc queries) 1 March 31st 06 01:08 PM
Autofilter More than One Worksheet David Mitchell Excel Programming 2 November 19th 03 08:36 AM


All times are GMT +1. The time now is 03:35 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"