I have a column of data where I have to extract the unique values and display them in another column. I'm using this method to do it.
However, when I run my program and get the unique values, I always get the first two rows of data of the same value(meaning range("A1") and ("A2") shows the same value) How to solve it? Pls help.Thankyou.PHP Code:Sub Find()
Worksheets("readtxt2").Activate
On Error Resume Next
If Range("A1").Value = "" Then
'// handle the error here and End
MsgBox "Could NOT exercute"
End
End If
'the range where it gets values n pastes it here
FindUniqueValues Range("D2 : D3000"), Worksheets("readtxt2").Range("H1")
On Error GoTo 0
End Sub
Sub FindUniqueValues(SourceRange As Range, TargetCell As Range)
SourceRange.AdvancedFilter Action:=xlFilterCopy, _
CopyToRange:=TargetCell, Unique:=True




Reply With Quote