Consulting

Results 1 to 4 of 4

Thread: comparing elements of 2 arrays

  1. #1
    VBAX Newbie
    Joined
    May 2018
    Posts
    2
    Location

    comparing elements of 2 arrays

    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.
    Last edited by anna2d3; 05-24-2018 at 12:40 AM.

  2. #2
    VBAX Regular
    Joined
    Jan 2018
    Location
    The Netherlands
    Posts
    45
    Location
    Quote Originally Posted by anna2d3 View Post
    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.

  3. #3
    VBAX Newbie
    Joined
    May 2018
    Posts
    2
    Location

    save

    I need it in a third array because i want to repeat the procedure with the thir array and a fourth array

  4. #4
    VBAX Regular
    Joined
    Jan 2018
    Location
    The Netherlands
    Posts
    45
    Location
    Quote Originally Posted by anna2d3 View Post
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •