+ Reply to Thread
Results 1 to 3 of 3

Array Formula Using WorksheetFunction

  1. #1
    Registered User
    Join Date
    09-05-2013
    Location
    Camarillo, CA
    MS-Off Ver
    Excel 2010
    Posts
    7

    Array Formula Using WorksheetFunction

    There's a post by this same title here: https://www.excelforum.com/excel-pro...tfunction.html

    I couldn't get this to work at all for me. I'm not clear on where the result is returned in a vba line like the following:
    ActiveSheet.Evaluate = "=1+1"

    The error is something like "couldn't get the evaluate property..."

    The formula in the post was:
    Activesheet.Evaluate = "=COUNT(IF(Location=""NY"",IF(Headcount,1)))"

    In my case, I'm trying to do the equivalent of =MATCH("TextText",B:B&C:C,0) in VBA. I'm not sure if the array aspect (have to use ctrl-shift in a worksheet) is an issue here or not since it's returning a single value. If not, then the above referenced post is not relevant here.

    The code I tried to use is:
    WorksheetFunction.Match("TextText", Range("B:B&C:C"), 0)

    and I get the error that the Range method failed. Is this kind of thing just beyond the scope of the worksheet functions?

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Array Formula Using WorksheetFunction

    Hi tbaker,

    What is the formula that works in your workbook cell? Use this formula in like cell F10.

    Now using VBA you would do a formula like:

    Activesheet.Range("F10").FormulaArray = <the one that works with double quotes for each single quote>
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Array Formula Using WorksheetFunction

    Hi,

    To use Evaluate you would assign the result to a variable
    Please Login or Register  to view this content.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

+ 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. Equivalent of worksheetfunction.sumif for an array
    By Rschwar23 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-08-2015, 02:17 PM
  2. WorksheetFunction.Percentile - Array Formula
    By Fjcosta in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-03-2015, 02:54 PM
  3. [SOLVED] Populating an Array with worksheetfunction.vlookup results
    By Speshul in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-30-2014, 11:22 AM
  4. WorksheetFunction.Sum returns 0 for array of elements whose sum is greater than 0
    By RowanB in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-12-2012, 06:15 AM
  5. Array Formula using Application.WorksheetFunction
    By Sonada in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-04-2009, 06:47 PM
  6. [SOLVED] [SOLVED] Array size limit when using WorksheetFunction.Transpose?
    By Ken Johnson in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-07-2006, 06:25 PM
  7. Array Formula Using WorksheetFunction
    By xcelion in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-18-2005, 07:15 AM

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