+ Reply to Thread
Results 1 to 8 of 8

Difference between two 2D Arrays

  1. #1
    Registered User
    Join Date
    11-23-2020
    Location
    Kyoto
    MS-Off Ver
    Microsoft Office Standard 2013
    Posts
    6

    Difference between two 2D Arrays

    I am trying to get a difference of two arrays as a third array.

    Here is a sample of what I am trying to do:

    sample.png

    So far I got this:

    Please Login or Register  to view this content.
    But I am getting a type mismatch error on this line:
    Please Login or Register  to view this content.
    Any one know what can be wrong? Or even if I am correct with the code so far?
    Attached Files Attached Files
    Last edited by Pimo; 11-24-2020 at 01:01 AM. Reason: solved

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,705

    Re: Difference between two 2D Arrays

    In your example, why does your Output show both mismatching records for toy4 but only one record for toy1?

    Is your sample data in your picture the same as what you are running the code on?

    When the error occurs, hover the cursor over arr1(i, j). What is the value?

  3. #3
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: Difference between two 2D Arrays

    you are getting the err for 2 reasons I believe. first of all, there are no elements in the array arr1(). second of all, according to this:

    https://docs.microsoft.com/en-us/off...r-applications

    you do not have the correct syntax of the method:
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    11-23-2020
    Location
    Kyoto
    MS-Off Ver
    Microsoft Office Standard 2013
    Posts
    6

    Re: Difference between two 2D Arrays

    --6StringJazzer so I added sample workbook, hope that it will be more clear


    --Adam, Can you tell me arr1() is empty? I can't get it because code for the array seems to be fine
    Also I have no idea what you mean with not correct syntax, Do you suggest that it should looks more like this?
    Please Login or Register  to view this content.
    Last edited by Pimo; 11-23-2020 at 10:33 PM. Reason: to not post 2 posts

  5. #5
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,516

    Re: Difference between two 2D Arrays

    This is to amend your original code.
    Please Login or Register  to view this content.
    Different method,
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    11-23-2020
    Location
    Kyoto
    MS-Off Ver
    Microsoft Office Standard 2013
    Posts
    6

    Re: Difference between two 2D Arrays

    thanks a lot! both works perfect!
    ありがとうございました!

  7. #7
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,516

    Re: Difference between two 2D Arrays

    You are welcome.
    どういたしまして。
    コロナには気を付けましょう。京都も大変なようですね。

  8. #8
    Registered User
    Join Date
    11-23-2020
    Location
    Kyoto
    MS-Off Ver
    Microsoft Office Standard 2013
    Posts
    6

    Re: Difference between two 2D Arrays

    気を付けましょう!第3波が来ているみたいですね。
    京都も大変。。。

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Querying Large Series of Arrays And Displaying Unique Values in Arrays [Hard Index Match?]
    By larryg003 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-28-2020, 04:52 PM
  2. Replies: 1
    Last Post: 07-29-2014, 08:26 AM
  3. Declaring multiple multi-dimensional arrays (jagged arrays) - compile error?
    By dfribush in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-20-2013, 05:06 PM
  4. Get the Difference between Two 2 D Arrays in VBA
    By pavanlalit in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 08-07-2013, 06:03 PM
  5. [SOLVED] New to arrays-where do I find a good beginners guide to multi dimensional arrays
    By mc84excel in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 06-04-2013, 07:44 PM
  6. [SOLVED] Need to count if the difference in values between two arrays is less than 5
    By italianiceman in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-07-2012, 03:08 PM
  7. [SOLVED] [SOLVED] VBA - averaging the difference of 2 arrays, ignoring blanks
    By RobPaolillo in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-08-2005, 04:05 PM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1