+ Reply to Thread
Results 1 to 2 of 2

424 Object Required error when referencing an array in a UDF

  1. #1
    Registered User
    Join Date
    03-25-2013
    Location
    New York
    MS-Off Ver
    Excel 2010
    Posts
    61

    424 Object Required error when referencing an array in a UDF

    EDIT: solved. The error comes from adding .Value on the end ... deleted, and works fine.


    I'm a total VBA noob, and have close to zero programming skills. Can anyone explain why I'm getting a 424 Object Required error on the first line where I try to use an array after I've defined it?

    Here's where I define the array:

    MyArray = Range("A" & (FirstRow) & ":B" & (LastRow)).Value

    and here's the line that the code bugs out on:

    MyVar = Analytic_Array(1, 1).Value

    I just can't figure out why this isn't working! Anybody have any idea what I'm doing wrong?
    Last edited by hadamhiram; 04-25-2013 at 10:59 PM. Reason: SOLVED

  2. #2
    Valued Forum Contributor AlvaroSiza's Avatar
    Join Date
    09-19-2007
    Location
    Staffordshire
    MS-Off Ver
    2007
    Posts
    591

    Re: 424 Object Required error when referencing an array in a UDF

    Unfortunately, you will need to provide a good bit more information in order for anyone to understand what's really going on. For example, your post does not speak to what MyVar and Analytic_Array are and how they were created. The array (MyArray) you defined is not referenced at all in the line of code claimed as the bug out culprit.

    I would suggest expanding on your problem, post code (using code tags) and possibly posting a sample workbook. This will greatly increase the chance that you have a successful solution developed.

    BTW - "VBA noob, close to zero programming" does not exactly translate well to array development, manipulation, and analysis. In other words, were VBA to be a class, arrays would be discussed in the 2nd half for sure. I would encourage you to get a good handle on the basics if you continue to pursue.
    Perhaps it was the Noid who should have avoided me...
    If you are satisfied with my solution click the small star icon on the left. Thanks
    1. Make a copy of your workbook and run the following code on your copy (just in case)
    2. With excel open, press ALT+F11 to open the Visual Basic Editor (VBE). From the "Insert" menu, select "Module".
    3. Paste the code from above into the empty white space. Close the VBE.
    4. From the developer tab, choose "Macros", select the Sub Name, and click "Run".

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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