You can use a collection instead of an array, and in doing so you don't have to worry about Rediming.After you have all the unique records in the collection you can loop thru the collection as follows:Code:Dim sDummy As String
Dim bFound As Boolean
Dim strMyData As String
Dim strPartNbr As String
Dim MyCollection As New Collection
' Add code to read a line from your file
' into strMyData, and the part number into strPartNbr
On Error Resume Next
'If the text is in the collection, Err = 0, otherwise it's not
sDummy = MyCollection.Item(strPartNbr)
bFound = (Err = 0)
If bFound Then
Err.Clear
MsgBox "Duplicate Part Number" & strPartNbr
Else
' This adds the data with a Key value of strPartNbr
MyCollection.Add strMyData, strPartNbr
End If
Dim intRec as Integer
For intRec = 1 to MyCollection.Count ' Collections start at 1
MsgBox MyCollection.Item(intRec)
Next
------------------
Marty
What did the fish say when it hit the concrete wall?
> > > > > "Dam!"
[This message has been edited by MartinLiss (edited 02-09-2000).]
