Hello All! First post, please be nice
I looked through but I didn't find any help yet. I am writing a code that checks two arrays against each other to determine if one of the array values is missing from the other. If the array value in one is not located in the other, then I want to load it to a third array for output to a file later on. The code I currently have is this:
For i = 1 To CheckArrayRange
AlreadyCleaned = False
For j = 1 To CleanedArrayRange
If CheckArray(i) = CleanArray(j) Then
AlreadyCleaned = True
End If
If AlreadyCleaned = False And j = (CleanedArrayRange - 1) Then
FinalArray(k) = CleanArray(j)
k = k + 1
End If
Next j
Next i
My ranges are determined by the length of the arrays themselves. The arrays are populating perfectly fine (tested by outputting to a different file) but when I output my third array (FinalArray) it is full with one specific value. Can anyone help?
I looked through but I didn't find any help yet. I am writing a code that checks two arrays against each other to determine if one of the array values is missing from the other. If the array value in one is not located in the other, then I want to load it to a third array for output to a file later on. The code I currently have is this:
For i = 1 To CheckArrayRange
AlreadyCleaned = False
For j = 1 To CleanedArrayRange
If CheckArray(i) = CleanArray(j) Then
AlreadyCleaned = True
End If
If AlreadyCleaned = False And j = (CleanedArrayRange - 1) Then
FinalArray(k) = CleanArray(j)
k = k + 1
End If
Next j
Next i
My ranges are determined by the length of the arrays themselves. The arrays are populating perfectly fine (tested by outputting to a different file) but when I output my third array (FinalArray) it is full with one specific value. Can anyone help?
Last edited: