+ Reply to Thread
Results 1 to 4 of 4

Using FormulaArray to Look Up nth value

  1. #1
    Registered User
    Join Date
    06-28-2016
    Location
    Atlanta, GA
    MS-Off Ver
    Office 2016
    Posts
    7

    Using FormulaArray to Look Up nth value

    I receive a data file weekly that's in a format I can not use so I am using VBA to get it into a format to track changes to statuses to projects over the last week. I first sort the data by date then, I am using several array formulas to look up the 1st, 2nd, Nth value.

    I am running into two issues currently.

    1) The code takes a while to run, mostly the copy formula part. Is this the best way to write this?
    2) If there is only 1 or 2 changes for that project on that week. The value that is returned in #NUM. When I wrap the formula in IFERROR(Formula,"") doing it manually it works fine. When I try to write it in the code, i get a:

    "Run time 1004 Error - Unable to set the FormulaArray property of the Range Class."

    Please Login or Register  to view this content.

    Thanks for any feedback,
    J

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,411

    Re: Using FormulaArray to Look Up nth value

    1) it's probably slow because of the full column references. Ideally, determine the specific range(s).
    2) I suspect you need to double up on the quote marks … "" >>> """"


    Fast answers need visual help. Please read the yellow banner at the top of this page on how to attach a file.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    06-28-2016
    Location
    Atlanta, GA
    MS-Off Ver
    Office 2016
    Posts
    7

    Re: Using FormulaArray to Look Up nth value

    Ive added the attachment to the thread.

    J
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    06-28-2016
    Location
    Atlanta, GA
    MS-Off Ver
    Office 2016
    Posts
    7

    Re: Using FormulaArray to Look Up nth value

    I added a test file with the code.

+ 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. .FormulaArray causes Run Time Error 1004, Unable to set the FormulaArray property
    By dluhut in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-28-2017, 03:12 PM
  2. [SOLVED] .FormulaArray =
    By Sc0tt1e in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-20-2016, 09:49 AM
  3. VBA FormulaArray
    By jadown in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-19-2013, 11:52 AM
  4. [SOLVED] FormulaArray
    By GreyBates in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-05-2013, 04:56 PM
  5. FormulaArray
    By efernandes67 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-29-2011, 06:32 PM
  6. DDE and FormulaArray problem
    By tlinetrader in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-06-2009, 12:54 PM
  7. Using FormulaArray in VBA
    By marcelobf in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-03-2006, 04:50 PM

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