Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
dan dan is offline
external usenet poster
 
Posts: 866
Default AUTOFILTER QUESTION

Hello. I have an autofilter in two different worksheets. I was wondering if
there is a way to read how a user has set the auto filter on a column one
sheet and apply it to a specific column on another sheet.

Also, is there a way to modify the default list for auto filter, or a way to
programatically create a custom autofilter? Thanks a lot for the help.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default AUTOFILTER QUESTION

Here is the help example on Autofilter Object. It should give you a good
start on doing what you want to do.

Dim w As Worksheet
Dim filterArray()
Dim currentFiltRange As String

Sub ChangeFilters()

Set w = Worksheets("Crew")
With w.AutoFilter
currentFiltRange = .Range.Address
With .Filters
ReDim filterArray(1 To .Count, 1 To 3)
For f = 1 To .Count
With .Item(f)
If .On Then
filterArray(f, 1) = .Criteria1
If .Operator Then
filterArray(f, 2) = .Operator
filterArray(f, 3) = .Criteria2
End If
End If
End With
Next
End With
End With

w.AutoFilterMode = False
w.Range("A1").AutoFilter field:=1, Criteria1:="S"

End Sub

Also, there is a custom setting in the drop down which allows you to set two
conditions.

You need to turn on the macro recorder and perform some of the actions you
describe and see what is recorded. This will again give you good insight
into what you can do.

--
Regards,
Tom Ogilvy



"Dan" wrote in message
...
Hello. I have an autofilter in two different worksheets. I was wondering

if
there is a way to read how a user has set the auto filter on a column one
sheet and apply it to a specific column on another sheet.

Also, is there a way to modify the default list for auto filter, or a way

to
programatically create a custom autofilter? Thanks a lot for the help.



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
Autofilter Question kate Excel Discussion (Misc queries) 0 April 25th 08 07:13 PM
Autofilter Question veryeavy Excel Discussion (Misc queries) 0 April 24th 08 02:00 AM
AutoFilter Question Ram Excel Discussion (Misc queries) 6 November 27th 06 04:05 PM
AutoFilter Question AccessHelp Excel Discussion (Misc queries) 2 September 29th 06 09:25 PM
Autofilter Question k9nny Excel Discussion (Misc queries) 1 February 28th 06 07:52 PM


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