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: 14
Default Advanced Filter - Unique Values

I am trying to put together a macro which will run an Advance filter and
bring back unique records. I need it to work on an range which may increase
or decrease. the code below works sometimes but depends I think what cell is
active when the macro is run.

Sub Test()
Dim Irange As Range
Dim ORange As Range
FinalRow = Cells(65536, 1).End(xlUp).Row
NextCol = Cells(1, 255).End(xlToLeft).Column + 2
Range(Selection, Selection.End(xlToRight)).Copy Destination:=Cells(1, NextCol)
Set ORange = Cells(1, NextCol)
Set Irange = Range("a1").Resize(FinalRow, NextCol - 2)
Irange.AdvancedFilter Action:=xlFilterCopy, copytorange:=ORange, Unique:=True
End Sub

Any ideas? Thank you for your help.

Esther
 
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
unique records by advanced filter Stefi Excel Discussion (Misc queries) 10 October 5th 09 08:04 AM
Advanced Filter - extracting unique records Balan Excel Worksheet Functions 2 September 4th 07 03:12 AM
Concatenate Unique advanced filter results SteveT Excel Discussion (Misc queries) 1 August 15th 06 03:17 PM
Error using Advanced Filter Unique Records headly Excel Discussion (Misc queries) 5 May 9th 06 01:36 AM
Inconsistent Results: Advanced Filter Unique Records Only KB Excel Discussion (Misc queries) 1 March 25th 05 02:34 PM


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