Showing posts with label Unique Values Using Advance Filter. Show all posts
Showing posts with label Unique Values Using Advance Filter. Show all posts

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


Import data from SQL

Macro to import data from SQL using ADO connection string: Sub Import_data_from_SQL() ' Tools -> References -> Microsoft Active...