+ Reply to Thread
Results 1 to 10 of 10

Expected Array Error

  1. #1
    Registered User
    Join Date
    02-14-2020
    Location
    Paris
    MS-Off Ver
    2016 on Mac
    Posts
    81

    Expected Array Error

    Hello All,

    I am having an error with " Expect array " Point at the red Row.

    This function is called in my Main SuB I don't think the error is related. What would be the cause as I can not see the error.

    Your help is much appreciated.

    Thank you.

    Najwa.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Question Re: Expected Array Error


    Salut !

    What is the value of the variable i ? …

  3. #3
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,313

    Re: Expected Array Error

    you have declared 'a' as an integer, try 'Variant'

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

    Re: Expected Array Error

    You are declaring a as a integer in the list of arguments, there for you can not redim.
    Looking at the code you are using a to hold temporary information so rename the variable.

    To clarify, rename the a variable you redim
    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

  5. #5
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,124

    Re: Expected Array Error

    You are currently passing a value to the function, only to destroy it.
    Change the name of your array

  6. #6
    Registered User
    Join Date
    02-14-2020
    Location
    Paris
    MS-Off Ver
    2016 on Mac
    Posts
    81

    Re: Expected Array Error

    Salut Marc,

    The value of the variable i is integer . It is counting the number of rows of Range X. You think it is related ?

    Merci.

  7. #7
    Registered User
    Join Date
    02-14-2020
    Location
    Paris
    MS-Off Ver
    2016 on Mac
    Posts
    81

    Re: Expected Array Error

    Ho Torachan,

    I tried Variant . Same error .

    Thank you !

  8. #8
    Registered User
    Join Date
    02-14-2020
    Location
    Paris
    MS-Off Ver
    2016 on Mac
    Posts
    81

    Re: Expected Array Error

    Ok will Correct it

  9. #9
    Registered User
    Join Date
    02-14-2020
    Location
    Paris
    MS-Off Ver
    2016 on Mac
    Posts
    81

    Re: Expected Array Error

    Indeed ! Got mixed with variables !

    Thx a lot for your help !

    Najwa.

  10. #10
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,124

    Re: Expected Array Error

    You're welcome & thanks for the feedback

+ 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. need help with error : compile error expected array
    By eggs in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-09-2017, 01:50 PM
  2. [SOLVED] Compile error: Expected Array
    By jkj115 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-27-2016, 03:01 PM
  3. [SOLVED] Compile error: expected array
    By JasperD in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-11-2015, 04:06 AM
  4. [SOLVED] GetOpenFileName: Expected Array Error
    By amphinomos in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-16-2014, 07:55 AM
  5. [SOLVED] Help with Compile Error: Expected Array
    By g8r777 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-05-2012, 11:44 AM
  6. Compile Error: Expected Array
    By abfrempong in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-13-2012, 02:35 AM
  7. Compile Error - Expected Array
    By AccountantCost in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-06-2009, 02:34 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