For some reason the code works well but it duplicates the 1st unique value in ZY3 and ZY4.. All renaming values are fine and not duplicated
If it helps, values within column ZX are formula based and the strangely, the first duplicate value in ZY3 contains a formula whereas the duplicate value in ZY4 does not
The 2nd code is me trying to make the 1st code sheet specific :)
Code: Select all
Sub CreateUniqueList()
Dim lastrow As Long
lastrow = Cells(Rows.Count, "ZX").End(xlUp).Row
ActiveSheet.Range("ZX3:ZX" & lastrow).AdvancedFilter _
Action:=xlFilterCopy, _
CopyToRange:=ActiveSheet.Range("ZY3"), _
Unique:=True
End Sub
Code:
Code: Select all
Sub CreateUniqueList()
Dim lastrow As Long
Dim wshS As Worksheet
Application.ScreenUpdating = False
Set wshS = Worksheets("CM_Shift")
lastrow = wshS.Cells(Rows.Count, "ZX").End(xlUp).Row
ActiveSheet.Range("ZX3:ZX" & lastrow).AdvancedFilter _
Action:=xlFilterCopy, _
CopyToRange:=ActiveSheet.Range("ZY3"), _
Unique:=True
End Sub
Code: