Hi Guys-
Any help would be much appreciated. I have a range of data (names) that I am trying to loop through and delete any instances where the name is repeating. Here is what I have so far.
Sub RemoveDuplicates()
Dim c As Range
Dim d As Range
Dim a, b, y, x, z, NewVal
For Each c In Range("A1:A2000"
x = c.Value
'run into trouble here referencing new range.
If d.Value = x Then
d.Value = " "
End If
Next
End Sub
I want to begin looking at the rest of the range for the duplicates. How do I reference a range that will begin one cell below where the above range is getting its value. So if A1 is Dan I want to delete all instances of Dan in the range of A2:A2000 or if I was on A2 begin comparing that value with the range A3:A2000. I know this is most likely an easy statement but it is totally slipping my mind. Appreciate your help.
Dan
Any help would be much appreciated. I have a range of data (names) that I am trying to loop through and delete any instances where the name is repeating. Here is what I have so far.
Sub RemoveDuplicates()
Dim c As Range
Dim d As Range
Dim a, b, y, x, z, NewVal
For Each c In Range("A1:A2000"
x = c.Value
'run into trouble here referencing new range.
If d.Value = x Then
d.Value = " "
End If
Next
End Sub
I want to begin looking at the rest of the range for the duplicates. How do I reference a range that will begin one cell below where the above range is getting its value. So if A1 is Dan I want to delete all instances of Dan in the range of A2:A2000 or if I was on A2 begin comparing that value with the range A3:A2000. I know this is most likely an easy statement but it is totally slipping my mind. Appreciate your help.
Dan