Hi, All.
Hope everyone is well.
I am using the below code to get unique values from one sheet to another by a command button. Now the fact is I want that unique value in a sort from in ascending order.
But failed to do it. Hope someone looks through my code and helps me to achieve the result.
I will really appreciate the kind help & concern of anyone.
Here In Name Manager of the workbook.
"Name: Extract, Value: Unique, Refers To: =Report!$W$9, Scope: Report"
Code
Sub Get_Unique()
Dim Sh1 As Worksheet
Dim rng As Range
Dim Sh2 As Worksheet
Set Sh1 = Sheets("Calculation")
Set rng = Sh1.Range("P2000:P" & Sh1.Range("P1000").End(xlUp).Row)
Set Sh2 = Sheets("Report")
rng.Cells(1, 1).Copy Sh2.Cells(1, 1)
rng.AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Sh2.Range("W9"), Unique:=True
End Sub
Thanks in Advance.