+ Reply to Thread
Results 1 to 5 of 5

Error entering an Array Eneter Formula using VBA

  1. #1
    Forum Contributor
    Join Date
    12-22-2012
    Location
    Pittsburgh, PA
    MS-Off Ver
    Excel 2007 & 2010
    Posts
    205

    Error entering an Array Eneter Formula using VBA

    I'm having difficulty entering an array entered formula using vba.

    I wrote the formula in the worksheet first using row/column format as per the following

    Please Login or Register  to view this content.
    The above formula worked great no issues, I then added the following to my sub routine

    Please Login or Register  to view this content.
    I get an error stating "Unable to set FormulaArray property of the Range class" it hangs up on the .FormulaArray line

    Any ideas as to what I'm doing wrong.
    Last edited by jprlimey; 11-26-2014 at 11:12 AM. Reason: SOLVED

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    6,265

    Re: Error entering an Array Eneter Formula using VBA

    You need to double every double quote within the outside double quotes, so the end is changed from

    ,"")"
    to

    ,"""")"

    The best thing to do with formulas in VBA is to get the formula working, then record a macro where you re-enter the formula.
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Forum Contributor
    Join Date
    12-22-2012
    Location
    Pittsburgh, PA
    MS-Off Ver
    Excel 2007 & 2010
    Posts
    205

    Re: Error entering an Array Eneter Formula using VBA

    Bernie,

    Thanks very much that did the trick, i complpetely forgot about the double quotes.

    Now it hangs up on the following line, with "Argument not optional" error

    Please Login or Register  to view this content.
    Thanks

  4. #4
    Forum Contributor
    Join Date
    12-22-2012
    Location
    Pittsburgh, PA
    MS-Off Ver
    Excel 2007 & 2010
    Posts
    205

    Re: Error entering an Array Eneter Formula using VBA

    I fixed the autofill using the following

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Again Bernie thanks for your guidance.
    Last edited by jprlimey; 11-26-2014 at 11:14 AM. Reason: change code tags location to capture all code

  5. #5
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    6,265

    Re: Error entering an Array Eneter Formula using VBA

    Your space is in the wrong place:

    .Range("B2").AutoFill .Range("B2:B" & lr)



    You could also just copy and paste - change that line to

    .Range("B2").Copy Range("B2:B" & lr)

+ 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. [SOLVED] #Value error on entering a formula using VBA
    By TC1980 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-12-2013, 09:03 AM
  2. Entering an array formula into cell , Modify it to suit need
    By cbhawsar in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-29-2011, 12:47 PM
  3. Array formula entering
    By themachine in forum Excel General
    Replies: 5
    Last Post: 07-06-2010, 09:02 AM
  4. #NAME Error when entering formula
    By flyhigh515 in forum Excel General
    Replies: 6
    Last Post: 11-24-2008, 03:27 PM
  5. Error when entering a formula
    By ken4capitola in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-23-2005, 04:25 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