Cross Checking Arrays Help

DannyB

New Member
Joined
Jul 13, 2011
Messages
1
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?
 
Last edited:

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Try something like:-
Code:
Range("A1").resize(ubound((FinalArray) )= application.transpose(FinalArray)
 
Upvote 0

Forum statistics

Threads
1,224,517
Messages
6,179,239
Members
452,898
Latest member
Capolavoro009

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top