+ Reply to Thread
Results 1 to 17 of 17

FormulaArray Error 1004

  1. #1
    Forum Contributor
    Join Date
    07-29-2013
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    110

    Unhappy FormulaArray Error 1004

    Hello geniuses,

    Could anyone please help me figure out what I got wrong in this ActiveCell.FormulaArray code?
    Been at it for an hour trying to find where the error comes from

    Please Login or Register  to view this content.
    Thanks in advance

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    49,024

    Re: FormulaArray Error 1004

    Well, it looks like you're indexing a single cell, so I'm not sure how that's going to work ...
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Contributor
    Join Date
    07-29-2013
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    110

    Re: FormulaArray Error 1004

    Hi TMS,

    The C6 refers to a column 6 in the Review Archive Sheet.
    should it be written a different way?
    I recorded this formula and got that

    Thanks

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    49,024

    Re: FormulaArray Error 1004

    As written, it looks (to me) is if it is trying to Index cell C6. If you want to index column 6, you'd use F:F.

    Please Login or Register  to view this content.

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    49,024

    Re: FormulaArray Error 1004

    Apologies, you're using R1C1 notation. Dohhhh...

    Which column are you putting the formula in?

  6. #6
    Forum Contributor
    Join Date
    07-29-2013
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    110

    Re: FormulaArray Error 1004

    Updated code with

    Please Login or Register  to view this content.
    still getting the error

  7. #7
    Forum Contributor
    Join Date
    07-29-2013
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    110

    Re: FormulaArray Error 1004

    Quote Originally Posted by TMS View Post
    Apologies, you're using R1C1 notation. Dohhhh...

    Which column are you putting the formula in?
    Yes sorry I didn't make my self clearer. the formula is in column F of the "Request Status" sheet.
    trying to get the data on Column F of "Review Archive" sheet via Index Match where 0(zero) or error is = to "" (blank)

  8. #8
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    49,024

    Re: FormulaArray Error 1004

    I assume you have this formula working in a cell? What is the actual formula in the cell and what cell is it?

  9. #9
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    49,024

    Re: FormulaArray Error 1004

    What error do you get and when do you get it?

  10. #10
    Forum Contributor
    Join Date
    07-29-2013
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    110

    Re: FormulaArray Error 1004

    This is the actual formula in the cell

    Please Login or Register  to view this content.
    the error says
    Run-time error ‘1004’ Unable to set the FormulaArray property of the Range Class

  11. #11
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: FormulaArray Error 1004

    Hi,

    This will be easier to sort out if you upload the workbook that contains the formula already entered in the Excel sheet. We can then understand what it's doing. I'm presuming of course that the formula in the sheet does not give an error.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  12. #12
    Forum Contributor
    Join Date
    07-29-2013
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    110

    Re: FormulaArray Error 1004

    Here's a sensitised version of the file

    thanks you both!
    Attached Files Attached Files

  13. #13
    Forum Contributor
    Join Date
    07-29-2013
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    110

    Re: FormulaArray Error 1004

    marking as solved as it seems there is a character limit of 255 on FormulaArray and the formula I am trying to add is about 350+ characters. Went a different route on this in terms of cells with 0(zero) results in formula.

    as per https://support.microsoft.com/en-au/kb/213181


    SYMPTOMS
    When you try to create an array formula by using a Visual Basic for Applications macro, you may receive the following error message:
    Run-time error '1004':
    Unable to set the FormulaArray property of the Range class.

    CAUSE
    This problem occurs when you try to pass a formula that contains more than 255 characters, and you are using the FormulaArray property in Visual Basic for Applications.
    Last edited by smartbuyer; 05-26-2016 at 01:23 AM.

  14. #14
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: FormulaArray Error 1004

    Hi,

    You didn't show the formula in the worksheet so it's difficult to know which fields you are trying to match on. I'm somewhat puzzled since the data suggests the Order number is already a unique field which means that a trivial INDEX(MATCH()) formula will get what you want

    If not and if several fields need to be matched add a helper column e.g. H2 =A2&B2&C2...etc that concatenates all the fields that determine what should be matched then the Index/match formula above can be used
    e.g. in H2 use a formula

  15. #15
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    49,024

    Re: FormulaArray Error 1004

    Create Dynamic Named Ranges for each of the columns on the Review Archive worksheet:

    nrRA_A:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    nrRA_B:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    nrRA_C:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    nrRA_D:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    nrRA_E:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    nrRA_F:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    nrRA_G:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Then your Array Formula becomes:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    And your code is then:

    Please Login or Register  to view this content.
    Attached Files Attached Files

  16. #16
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    49,024

    Re: FormulaArray Error 1004

    Note that, if you are expecting text/string values to be returned, rather than numeric data, your Array Formula could be just:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    And the code would be this (putting it in column H for comparison):

    Please Login or Register  to view this content.

  17. #17
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    49,024

    Re: FormulaArray Error 1004

    Oh, and I should have said, using the Dynamic Named Ranges will not only make the formula shorter, but it will also improve calculation performance significantly over using whole column references.

+ 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. VBA Run time error on FormulaArray
    By tlscowden in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-19-2015, 10:52 PM
  2. 1004: Unable to set the FormulaArray property of the Range class
    By drrazor in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-10-2015, 11:39 AM
  3. [SOLVED] FormulaArray in VBA error message - not sure why
    By fredderf81 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-13-2015, 12:52 PM
  4. long formula to vba macro - error 1004 unable to set formulaarray property
    By desibabuji in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-08-2013, 06:18 AM
  5. unable to set FormulaArray property of Range Class Error
    By BuglerX in forum Access Programming / VBA / Macros
    Replies: 1
    Last Post: 11-23-2011, 01:13 PM
  6. unable to set FormulaArray property of Range class Error
    By BuglerX in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-23-2011, 12:14 PM
  7. Unable to set the FormulaArray Property of the Range Class - Error 1004
    By manchmal2 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-24-2010, 05:08 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