PDA

View Full Version : comparing elements of 2 arrays



anna2d3
05-24-2018, 12:13 AM
Hallo guys,

I am pretty new in vba and want to try something. I have 2 dynamic multidimensional arrays and want to compare elements with both arrays. For example in the first element of Array 1 are names and also in the first element of Array2. If the names in element of Array 1 and Array 2 are the same, multiply element 2 of Array 1 by element 2 of Array 2.

Example:

Array 1
Paul John etc.
34 36 etc.

Array 2
Paul Harry etc.
7 5 etc.

So in this case it should multiply 34 by 7 and write the answer a third array
If the names don't equal, skip to next element and compare. I am sorry my english is not the best. Hope you understand what I mean. I would be very greatful if you could help me.

Hightree
05-24-2018, 03:11 AM
Hallo guys,

I am pretty new in vba and want to try something. I have 2 dynamic multidimensional arrays and want to compare elements with both arrays. For example in the first element of Array 1 are names and also in the first element of Array2. If the names in element of Array 1 and Array 2 are the same, multiply element 2 of Array 1 by element 2 of Array 2.

Example:

Array 1
Paul John etc.
34 36 etc.

Array 2
Paul Harry etc.
7 5 etc.

So in this case it should multiply 34 by 7 and write the answer a third array
If the names don't equal, skip to next element and compare. I am sorry my english is not the best. Hope you understand what I mean. I would be very greatful if you could help me.
Hoi pit, ik zoek naar de inhoud van de cd van Eric Clapton maar waar ik ook klik, ik krijg niets ��
why do write it into a third array, I expect that it must be saved.

anna2d3
05-24-2018, 04:14 AM
I need it in a third array because i want to repeat the procedure with the thir array and a fourth array

Hightree
05-25-2018, 11:03 AM
I need it in a third array because i want to repeat the procedure with the thir array and a fourth array

Why can’t you do that the same time?, use the same procedure only with other parameters