Hi I want to do some sorting on ranges and reset the range using offset but it isn't working.
I have a table of data and want to sort/remove duplicates on each column separately. There are about 100 columns.
I have a table of data and want to sort/remove duplicates on each column separately. There are about 100 columns.
VBA Code:
Sub Macro1()
Dim x2 As Range
Dim y2 As Range
Dim i As Integer
Set x2 = Range("C2:C100000")
For i = 1 To 100
Set x2 = Range("C2:C100000").Offset(0, i)
Range(x2).Select
ActiveSheet.Range(x2).RemoveDuplicates Columns:=1, Header:=xlYes
Next i
End Sub