Hello! First of all I want to mention that I'm new both to VBA and this forum. So, I'm having some problems in a project I'm working at. I have a project that requires me to compare a fixed length array to a dynamic array.
The thing is though, i want to compare each element of the first array with every element of the second array, and if i get a match do something, and delete the matched elements from the second array. Then, again, compare them, see that there are no matches, calculate the difference between the first element of the first array and the first element of the second array, and add it to all of the elements of array 1, therefore equalizing them so that they can be deleted once more. And so on... i'm gonna do an example below, because i don't know if i made any sense.

A1=(0,50,100,150)
A2=(0,100,150,200,250,300,350)
after comparison, 0=0, 100=100, and 150=150 => do something, then recreate the elements:
A1=(0,50,100,150)
A2=(200,250,300,350)
compare them again, there are no matches, so add 200(elem1-elem1 of each array) to the first array=>
A1=(200,250,300,350)
A2=(200,250,300,350)
now that i have a match, all element can be deleted, so the second array will be emptied . Basically, the first array empties the second one step by step, by equalizing the elements.

This is what i have so far (the testArray is being filled up after user input):

.
.
.
.
Dim pArray(3) As Variant          'the comparison array
Dim pArrayIndex As Long
     pArray(0) = 0
     pArray(1) = 75
     pArray(2) = 150
     pArray(3) = 225


Dim tempArray() As Variant
Dim x As Long, arrCounter As Long


'test comparison
     For pArrayIndex = LBound(pArray) To UBound(pArray)
           For Index = LBound(testArray) To UBound(testArray)
                 If pArray(pArrayIndex) = testArray(Index) Then
                       MsgBox (pArray(pArrayIndex) & "from array 1 is equal to" & testArray(Index) & "from array 2")
                       
'delete the duplicate value from array 2
                       ReDim Preserve tempArray(arrCounter)
                       tempArray(arrCounter) = testArray(Index)
                       arrCounter = arrCounter + 1
                       
'generate smth using each deleted index
                 
                   End If

           Next Index
       Next pArrayIndex
       testArray = tempArray
'displaying the items that should be removed          
Dim msg As Variant

           For i = LBound(testArray) To UBound(testArray)
                   msg = msg & testArray(i) & vbNewLine
           Next i
           MsgBox ("the values of my temp array, that should be removed are: " & vbNewLine & msg)
So, after finding the duplicate values, and removing those elements ONLY from the 2nd array, i should make an addition to the first array, such that i would cause 2 other duplicates, and do this over and over again, until i've removed all of the 2nd array's elements...

Please help me.
Thank you!