Monday, September 15, 2008

Return The Last Repeated Record

If the records are repeated, then the late repeated record will be reported only.

Sub distinct_value_lower()

Dim pointers As String
pointers = Range("a1").Value
'Debug.Print "1:" & pointers

For x = 2 To 36
If Range("A" & x).Value = pointers Then
pointers = Range("A" & x).Value
Else
Range("B" & x - 1).Value = pointers
pointers = Range("A" & x).Value
End If
Next
End Sub

No comments: