I want to write a code that will erase the duplicated value within a row of uncertain size, i.e. I don't know where the duplicated value will apear.
I thought that I may be able to use RemoveDuplicates property within a range but it only works for duplicates within column. That's why I am stacked.
This is the case before running the code:
And this is my desired outcome:
I really wish to have a code that will use resizable range with rows.count as I said, I don't know where the duplicate can appear and the row can be very long (up to 500 records).
This is what tried but obviously, I cannot use as there is no Remove duplicate property within row:
Sub RemoveDuplicates()
Dim ws1 As Worksheet
Set ws1 = Sheets("Sheet1")
Dim rng As Range
Dim LastCol As Integer
With ws1
LastCol = .Cells(2, Columns.Count).End(xlToLeft).Column
Set rng = .Range(.Cells(2, 1), .Cells(2, LastCol))
rng.RemoveDuplicates ????
End With
I would appreciate any help.