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: 123
Default Advanced filter macro

I have a system fromwhich i need to prepare MIS.

I dump all the files into one file then i do advanced filter to get results
i need.

I recorded a macro and did come changes to make it suitable for my project.
below is the code.

' do advanced filter

Range("A1:AD65000").AdvancedFilter Action:=xlFilterInPlace,
CriteriaRange:= _
Sheets("Filterref").Range("A1:AD16"), Unique:=False
Sheets("raw").Select
Range("A1").Select

' copy required data into another sheet

ActiveCell.Range("A1:AD65000").Select
Selection.Copy
Sheets("brkp").Select
Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Range("A1").Select
Sheets("raw").Select
Range("A1").Select

'remove filter
With ActiveSheet
If .FilterMode Then
.ShowAllData
End If
End With

Application.CutCopyMode = False

The filter is processed on the basis of the range specified.

"Sheets("Filterref").Range("A1:AD16"), Unique:=False"

Can the filter reference be something like

Range(Selection, Selection.End(xlUp)).Select

I mean can the range be set to all the cells in some specific sheet.

Please let me know. Thanks!
Boss


 
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
Advanced Filter Macro Failing Mustang Excel Discussion (Misc queries) 3 June 18th 09 05:15 AM
Advanced Filter Macro Alex.W Excel Discussion (Misc queries) 1 April 4th 08 12:19 PM
Advanced Filter Macro Dolphinv4 Excel Discussion (Misc queries) 2 March 20th 08 11:42 AM
Using Advanced Filter through Macro Prashant Garg[_2_] Excel Programming 4 December 18th 04 01:28 AM
VB Application for Advanced filter Macro Poogy Excel Programming 1 August 19th 03 03:37 PM


All times are GMT +1. The time now is 09:11 AM.

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

About Us

"It's about Microsoft Excel"