+ Reply to Thread
Results 1 to 7 of 7

How to make Long FormulaArray macro to work? :(

  1. #1
    Forum Contributor
    Join Date
    06-18-2012
    Location
    Kuching, SARAWAK
    MS-Off Ver
    Excel 2010
    Posts
    116

    How to make Long FormulaArray macro to work? :(

    Dear Excel Expertise,

    I had an error which I googled showing the meaning is that my formula is too long (>255 chars). I tried to cut them into lines like below but I still got the same error. Can anybody be kind enough to correct my formula, please? I have tried to troubleshoot for hours..

    Please Login or Register  to view this content.

    Thank you in advance.

    DZ

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: How to make Long FormulaArray macro to work? :(

    Does the formula work if you copy it from below and paste it in the cell?

    =IFERROR(IF(RC7=MIN(IF(INDIRECT("A2:A"&COUNTA(C[-7]))=RC1,IF(INDIRECT("F2:F"&COUNTA(C[-7]))=RC6,INDIRECT("G2:G"&COUNTA(C[-7])),""),"")),IF(OR(OR(RC6="NGIN_SERVICE",RC6="NGIN_PBO",RC6="NGIN_MS"),OR(RC6="NGIN_DISPUTE-NON_PBO",RC6="NGIN_DISPUTE_NON_PBO",RC6="HQ_PREPAID"),RC6="HQ_CAS"),"Huawei",""),""),"")
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: How to make Long FormulaArray macro to work? :(

    If you put the OR comparison values in a Range, you could replace this...
    IF(OR(OR(RC6="NGIN_SERVICE",RC6="NGIN_PBO",RC6="NGIN_MS"),OR(RC6="NGIN_DISPUTE-NON_PBO",RC6="NGIN_DISPUTE_NON_PBO",RC6="HQ_PREPAID"),RC6="HQ_CAS"), ...

    With something like this...
    IF(ISNUMBER(MATCH(RC6,Z1:Z10,0)), ...
    Where Z1:Z10 is the list range (convert that to R1C1 refernce)
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: How to make Long FormulaArray macro to work? :(

    That's a fine idea.

    Here's another way:

    Please Login or Register  to view this content.
    Last edited by shg; 04-12-2016 at 08:34 PM.

  5. #5
    Forum Contributor
    Join Date
    06-18-2012
    Location
    Kuching, SARAWAK
    MS-Off Ver
    Excel 2010
    Posts
    116

    Re: How to make Long FormulaArray macro to work? :(

    Yes, it does, shg. I will record first before I amend the line of rows for the range of data in the editor.

  6. #6
    Forum Contributor
    Join Date
    06-18-2012
    Location
    Kuching, SARAWAK
    MS-Off Ver
    Excel 2010
    Posts
    116

    Re: How to make Long FormulaArray macro to work? :(

    Quote Originally Posted by shg View Post
    That's a fine idea.

    Here's another way:

    Please Login or Register  to view this content.
    Ouh, this one I will try by EOD. Really appreciate the effort. Thanks!

  7. #7
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: How to make Long FormulaArray macro to work? :(

    The code inserts your formula (I checked ). But AF's suggestion of making the formula shorter is a better place to start, IMO. It would make the formula easier to understand, for one thing.

+ 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. Replies: 4
    Last Post: 09-16-2015, 08:07 AM
  2. Semi-Urgent: Work Around for Formula & FormulaArray Size Limit
    By JaedenRuiner in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-21-2015, 01:25 AM
  3. FormulaArray does not work for more than 255 characters
    By linok in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-19-2014, 06:08 AM
  4. Combo Box Autocomplete - Can't make it work for long list
    By ELapointe in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-25-2014, 12:30 AM
  5. 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
  6. [SOLVED] How to make the macro work for all rows in the work sheet
    By Valli nayaki in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-18-2013, 10:43 PM
  7. 'lastrow =' How long does statement 'work' in macro?
    By BEEJAY in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-12-2012, 08:39 AM

Tags for this Thread

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