+ Reply to Thread
Results 1 to 2 of 2

Convert array formula into vba code

Hybrid View

  1. #1
    Registered User
    Join Date
    04-25-2011
    Location
    Noida, India
    MS-Off Ver
    Excel 2010
    Posts
    16

    Convert array formula into vba code

    Hi,
    I am currently using a formula to calculate a result and then my macro does further processing on the data.

    The problem is that this formula needs to be entered into a very large number of rows (~5000 rows). This makes it extremely slow and many times when the rows are more than ~6500, the formula fails to function. (as the formula also points to a range in another sheet).

    Is there some way by which I can calculate the same result from within VBA and then continue processing the data as usual?

    the formula is as below

    
    =SUM(--ISNUMBER(MATCH('[Book1.xls]Input'!$E$2:$E$" & LastRow2 & ",A2:CZ2, 0)))

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Convert array formula into vba code

    You can use worksheet functions within VBA by use of the WorksheetFunctionObject.

    Something like....

    X = Worksheetfunction.Sum(--worksheetfunction.IsNumber(worksheetfunction.Match.....
    ...maybe?
    Martin

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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