Hi
I recorded a macro to remove duplicates from data in column A.
The data set was very simple - I had the number 1 in cells A1, and A2, respectively.
And the number 2 in cells A3, and A4, respectively.
However, this code only works on a fixed range. Does anyone know how to make it dynamic, please?
I recorded a macro to remove duplicates from data in column A.
The data set was very simple - I had the number 1 in cells A1, and A2, respectively.
And the number 2 in cells A3, and A4, respectively.
However, this code only works on a fixed range. Does anyone know how to make it dynamic, please?
VBA Code:
Sub remove_duplicates()
Columns("A:A").Select
ActiveSheet.Range("$A$1:$A$4").RemoveDuplicates Columns:=1, Header:=xlNo
End Sub