Results 1 to 11 of 11

Long Array Formulas Using VBA

Threaded View

  1. #1
    Registered User
    Join Date
    05-01-2013
    Location
    Chicago
    MS-Off Ver
    Excel 2010
    Posts
    7

    Long Array Formulas Using VBA

    I am trying to get the following long array into a vba sub procedure, however it continues to give the 'cannot set the formula array into the range class' error despite each of the pieces being less than 255 characters. Any help would be appreciated.

    Thanks.

    Dim rows As Long
        Dim rows1 As Long
        Dim form1 As String
        Dim form2 As String
        Dim form3 As String
                        
        rows = Worksheets("EOD t-1").Range("H1").End(xlDown).Row
        rows1 = ActiveSheet.Range("G1").End(xlDown).Row
            
        form1 = "=IF(RC[-2]=0,SUM(IF(FREQUENCY(IF('EOD t-1'!R2C1:R" & rows & "C1=EOD!RC[-7],IF('EOD t-1'!R2C3:R" & rows & "C3=RC[-5]," & _
                "X_X())" & _
                "X_X_X())"
        form2 = "MATCH('EOD t-1'!R2C1:R" & rows & "C1&'EOD t-1'!R2C2:R" & rows & "C2&'EOD t-1'!R2C3:R" & rows & "C3,'EOD t-1'!R2C1:R" & rows & "C1&'EOD t-1'!R2C2:R" & rows & "C2&'EOD t-1'!R2C3:R" & rows & "C3,0))),"
        form3 = "ROW('EOD t-1'!R2C1:R" & rows & "C1)-ROW('EOD t-1'!R2C1)+1),'EOD t-1'!R2C8:R" & rows & "C8)),RC[-3]/(RC[-2]/100))"
        
        With ActiveSheet.Range("H2:H" & rows1 & "")
            .FormulaArray = form1
            .Replace "X_X())", form2
            .Replace "X_X_X())", form3
            .NumberFormat = "_($* #,##0_);_($* (#,##0);_($* ""-""??_);_(@_)"
        End With
    Last edited by alansidman; 12-20-2013 at 10:32 AM. Reason: code tags added.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Array Formulas taking too long to calculate
    By CheeksExcelForum in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-17-2013, 06:56 PM
  2. How can one populate a long array?
    By StevenM in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-21-2012, 09:13 AM
  3. Long Array Formula VBA
    By maacmaac in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-27-2011, 08:57 AM
  4. Codes to long Possible Array may help ?
    By realniceguy5000 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-27-2009, 09:11 AM
  5. Array Formulas take waaaay too long...
    By belly0fdesire in forum Excel Formulas & Functions
    Replies: 39
    Last Post: 09-06-2005, 07: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