Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
unique records by advanced filter | Excel Discussion (Misc queries) | |||
Advanced Filter - extracting unique records | Excel Worksheet Functions | |||
Concatenate Unique advanced filter results | Excel Discussion (Misc queries) | |||
Error using Advanced Filter Unique Records | Excel Discussion (Misc queries) | |||
Inconsistent Results: Advanced Filter Unique Records Only | Excel Discussion (Misc queries) |