Results 1 to 3 of 3

Array formula in macros

Threaded View

  1. #1
    Registered User
    Join Date
    09-30-2005
    Posts
    4

    Exclamation Array formula in macros


    I am trying to set up a macro that calculates balances per individual per month. When manually setting up the spreadsheet the array formula has returned the correct result but I am getting an error when the formula is included in a macro.

    The error message returned is:
    "Run-time error '1004':
    Unable to set the FormulaArray property of the Range class"


    The relevant section of code is:
    (please note that I have manually wrapped the code below as when I tried to use the underscore character to wrap the formula I get an immediate syntax error)
    The logic of the formula below is that if the values in columns E & F are equal then no value is required (the starting IF stmt). If the values are not equal then the formula will return values from 3 data sheets.
    
      Sheets("Ageing Rpt").Select
      Range("G2").Select
      Selection.FormulaArray = _
         "=IF('Ageing Rpt'!RC[-2]-'Ageing Rpt'!RC[-1]=0,0,
           SUM(IF('Comm extracts - cumulative'!R[1]C[3]:R[2000]C[3]
             =CONCATENATE('Ageing Rpt'!RC[-6],""/"",EOMONTH(CurMth,-1)),
              'Comm extracts - cumulative'!R[1]C:R[2000]C))
           +SUM(IF('Manual Adj'!RC:R[2000]C
            =CONCATENATE('Ageing Rpt'!RC[-6],""/"",EOMONTH(CurMth,-1)),
             'Manual Adj'!RC[-5]:R[2000]C[-5]))
           -SUM(IF(Pmts!RC[-1]:R[2000]C[-1]
            =CONCATENATE('Ageing Rpt'!RC[-6],""/"",EOMONTH(CurMth,-1)),
             Pmts!RC[-4]:R[2000]C[-4])))"
    Hopefully someone can make me
    Last edited by mudraker; 04-20-2007 at 09:41 AM.

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