• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

advanced filter unique macro giving unexpected results

RAM72

Member
Hi All

I have trouble with a macro for advanced unique from column G to I of working sheet to summary sheet

In summary sheet it gives only unique results for column A and C but column B remains blank !!!! when applying macro:mad::(

Can anyone look what is going wrong

Code:
Option Explicit       
       
Sub FilterUnique1()       
    'Tariff No  Description Origin       
           
    With Sheet2       
        .Range("A1:C1").Value = Sheet1.Range("G1:I1").Value       
               
        '        ''./// clear any existing data       
        .Range("A1").CurrentRegion.Offset(1).Clear       
        '/// copy required data to summary sheet       
        Sheet1.Range("A1").CurrentRegion.AdvancedFilter Action:=xlFilterCopy, _       
        CopyToRange:=.Range("A1:C1"), Unique:=True       
        .Range("A1:C1").Columns.AutoFit       
    End With       
End Sub
 

Attachments

  • TESTAUTOFILTER .xlsx
    40.5 KB · Views: 4
You have two Description columns. Either rename one of them, or change the filter range so that it only includes the three columns you want.
 
Back
Top