+ Reply to Thread
Results 1 to 3 of 3

Run Time Error 1004 within Array

  1. #1
    Forum Contributor
    Join Date
    09-05-2011
    Location
    Essex, England
    MS-Off Ver
    Excel 2003 Excel 2007
    Posts
    383

    Run Time Error 1004 within Array

    Hi All,

    I'm running the code below and it all seems to work fine until the 25th cycle (of R) through (in the data set i'm using for testing there should be 28 cycles), where it'll stop at the line .Range("A2").Resize(N - 1, UBound(Arr2, 2)) = Arr2
    giving the error message Run-time error '1004': Application-defined or object-definition error. I'm a little baffled by this as all this line is doing is pasting data from the array into the worksheet (something it did successfully the previous 24 cycles). I've ran this a few times and it always stops at the same location.

    Anyone have any idea why this might be?

    Please Login or Register  to view this content.

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,610

    Re: Run Time Error 1004 within Array

    .Resize(N - 1, UBound(Arr2, 2))===> check if N = 0 or negative
    Ben Van Johnson

  3. #3
    Forum Contributor
    Join Date
    09-05-2011
    Location
    Essex, England
    MS-Off Ver
    Excel 2003 Excel 2007
    Posts
    383

    Re: Run Time Error 1004 within Array

    WOW! protonLeah thank you so much for your help! it's so obvious once someones kindly pointed it out to you.

    just had to change
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.
    and looks to have solved "this issue", think I have another one but just looking into that now.

    thank you so much for your assistance.

+ 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] Sort Macro Run-time error '1004': Application/Object-defined error.
    By sam1212 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-22-2014, 10:05 AM
  2. Error "run-time Error '1004': General Odbc Error
    By D4WNO77 in forum Access Tables & Databases
    Replies: 2
    Last Post: 07-16-2012, 09:55 AM
  3. Array loop producing error "Run time error '1004'"
    By jeskit in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 05-06-2011, 08:56 AM
  4. Comparing a string to values in an array resulting in a Run time Error 1004
    By sgreni in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-15-2009, 04:21 PM
  5. [SOLVED] run-time error '1004': Application-defined or object-deifined error
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-10-2005, 05:05 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