Advanced filter unique do not working properly.

Ferreira1456

New Member
Joined
Mar 20, 2018
Messages
30
Office Version
  1. 365
Platform
  1. Windows
For some reason advanced filter unique do not working properly.
rsp-content-status-subscribed.png


Could you please help me?
Please take at look on my Macro and show me where is the problem. One of the error is the very first one.
Public Sub CustomerList()

Dim rngData As Range
Dim lin As Long
Dim li As ListItem

Sheet1.Select

With Sheet1
Set rngData = .Range("B2:C" & .Range("B" & Rows.Count).End(xlUp).Row)
rngData.AdvancedFilter Action:=xlFilterCopy, _
CopyToRange:=.Range("AA1"), _
Unique:=True

lin = 1
Do While .Cells(lin, "AA") <> ""
Set li = UserFormCustomer.listvBetweenDates.ListItems.Add(Text:=" ")
li.ListSubItems.Add Text:=.Cells(lin, "AA").Value
li.ListSubItems.Add Text:=.Cells(lin, "AB").Value
lin = lin + 1
Loop
.Range("AA1:AB" & .Range("AA" & Rows.Count).End(xlUp).Row + 1).ClearContents
.Cells(1, 1).Activate
End With
 
Hi Anthony47. Thank you very much for your help.
like you said,Excel don't fail... So The only thing I need on the entire line is columns B and C are exactly the same [. . .]

I did not understand if you discovered the small difference on the lines that look duplicated ("Excel don't fail") or it is still unclear ("B and C are exactly the same")

If it is still unclear, use the formula
Code:
=FirstValue=OtherValueThatLooksDuplicated
Example =AA2=AA12
If the result is True (on both columns) then... even Excel fails; I would be interested in looking at your table of data and see how the macro fails

By the way, clear Range("AA:AB") before populating them with the (pseudo)unique records (to be sure that there is not a remnant of a previous extraction)

Bye
 
Upvote 0

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
I have complicates the question. I need that Excel search the unique value at column "A" and the unique value at column "B". In column "A" I have the Account Number "1234" and "B" I have the Customer Name "Microsoft"
 
Upvote 0
I am not sure about your request... If you can get unique values from two columns, with the same approach you can get unique values from single columns...
Could you share a sample workbook with sample data and, based on those data specify which output you would expect?
To share a file please use a file sharing service, like dropbox.com or filedrop.com

Bye
 
Upvote 0

Forum statistics

Threads
1,214,943
Messages
6,122,370
Members
449,080
Latest member
Armadillos

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top