Pages

Saturday, June 4, 2011

Unique Values Using Advance Filter

If you want to find the unique values in a list . Snapshot below -




Try this code (done it using Advance Filter)- 


Sub unique_values()
    
    'remove if any filter
    If Sheets("Main").FilterMode Then
        Sheets("Main").ShowAllData
    End If

'clear existing data if any in col K
Sheets("Main").Range("k:k").Clear

'extract unique values
Sheets("Main").Range("a1:a" & Sheets("Main").Range("a65356").End(xlUp).Row).AdvancedFilter Action:=xlFilterCopy, _
CopyToRange:=Sheets("Main").Range("k1"), Unique:=True


End Sub


Download Working File


No comments:

Post a Comment