+ Reply to Thread
Results 1 to 5 of 5

incompatible types in array comparison

  1. #1
    Registered User
    Join Date
    02-08-2021
    Location
    Brussels, Belgium
    MS-Off Ver
    2007
    Posts
    11

    incompatible types in array comparison

    Good morning,

    i have an error occuring in my code, but im too bad to understand how this issue might be to solve, I've excluded everything not relating to the problem:

    Please Login or Register  to view this content.
    Last edited by Fyv03; 02-09-2021 at 04:01 AM.

  2. #2
    Registered User
    Join Date
    02-08-2021
    Location
    Brussels, Belgium
    MS-Off Ver
    2007
    Posts
    11

    Re: incompatible types in array comparison

    If I substitute the comparison by "vArrGesamt(i, 2) = vArrAT(j, 1)" it works

    But im thinking its the same thing, what might that be?

  3. #3
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,419

    Re: incompatible types in array comparison

    It hard to test you code, or even create a file to test.

    But the issue is you are assigning an array to an element of the vArrQm array.

    Please Login or Register  to view this content.
    prior to using the array you define it as being
    Please Login or Register  to view this content.
    perhaps you meant to include a row/column index as you did for the other array
    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

  4. #4
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,513

    Re: incompatible types in array comparison

    vArrQm = Workbooks("ALL.xlsx").Worksheets("DUM").Cells(1, 7).Resize(iZeile2, 4)

    vArrQm array is having only 4 columns.

    vArrQm(i, 5) = vArrArtikel(i, 1)
    vArrQm(i, 6) = vArrAT

    Here you are referring to the 5th and 6th columns of the array vArrQm
    So Error will be

    "Subscript out of range"
    Last edited by kvsrinivasamurthy; 02-09-2021 at 05:06 AM.
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  5. #5
    Registered User
    Join Date
    02-08-2021
    Location
    Brussels, Belgium
    MS-Off Ver
    2007
    Posts
    11

    Re: incompatible types in array comparison

    Not quite correct, but you got the problem right.

    I forgot to put "vArrQm(i, 6) = vArrAT(i, 1)" instead of "vArrQm(i, 6) = vArrAT"

    Thank you, i guess im just tired^^

+ 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. Importing a delimited text file with different data types into an array
    By ifthenifthen in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-20-2018, 06:43 PM
  2. [SOLVED] Array formula to help comparison of points
    By lar9149 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 11-04-2016, 03:41 PM
  3. Array Definition - Different Data Types for each column
    By dax2ib in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-15-2013, 08:53 AM
  4. incompatible types
    By JoaoCampelo in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-19-2013, 07:10 AM
  5. Incompatible Data Types
    By RoyMakaay1985 in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 09-09-2009, 05:02 PM
  6. String array values to array of User-Defined Types
    By rtiltins in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-03-2008, 07:45 AM
  7. [SOLVED] Writing an array(2d) of user types to a worksheet
    By John Keith in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-06-2005, 08:30 PM

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