so I am trying to copy unique values from a column after applying several filters to it. For one of the filter I cant filter by exact string because the column is like this:
I want the values which have "U" in 8th position from right and want to ignore the ones which have "O" in the same place.
So for example, in the image: 'S20-0260-TA-002_W06_05C_AMBRH_U-404728' should be present but 'S20-0260-TA-001_W06_30C_75RH_O-404713' shouldn't be.
I know how to check a character from right, from the RIGHT function but I am struggling to apply it in a filter with if condition. This is my relevant code so far with other filters:
Dim uniquesArray As Variant
Dim uniqueCond As Variant
Dim lastCondRow As Long
Dim lastRow As Long
Dim ws As Worksheet
Set ws = ThisWorkbook.Sheets("New Data")
lastRow = ws.Cells(Rows.Count, 1).End(xlUp).Row
Set DR = ThisWorkbook.Sheets("Test")
With ThisWorkbook.Sheets("Test")
'Find unique Condition
Worksheets("New Data").Range("$B$1:$X$9999").AutoFilter Field:=10, Criteria1:= _
"Assay by HPLC"
Worksheets("New Data").Range("$B$1:$X$9999").AutoFilter Field:=15, Criteria1:= _
"(Average)"
ws.Range("I1:I9999").SpecialCells(xlCellTypeVisible).Copy
.Cells(1, 27).PasteSpecial
.Columns("AA:AA").AdvancedFilter Action:=xlFilterCopy, CopyToRange:=.Range("AB1"), Unique:=True
lastCondRow = .Cells(.Rows.Count, "AB").End(xlUp).Row
uniqueCond = .Range("AB2:AB" & lastCondRow)
.Columns("AB").ClearContents
.Columns("AA").ClearContents
End With
I want to apply this filter as well below the 2 auto-filters under the find unique comment. The column number is F, please help
