+ Reply to Thread
Results 1 to 10 of 10

Autofill FormulaArray with vba

  1. #1
    Registered User
    Join Date
    11-13-2013
    Location
    Trollhättan, Sweden
    MS-Off Ver
    Excel 2007
    Posts
    22

    Autofill FormulaArray with vba

    Hi all.
    Trying to get this fromulaArray:

    " =MIN(IF(Data!C[-1]=R[1]C[-1];Data!C;""))" or " =MIN(IF(Data!A:A]=A2;DataB:B;""))"
    to fill a range e.g B2:B50

    Ive read and tried diffrent thing but wasnt able to work around the errors i got.
    My last attempt i recorded a macro and got this code to work with
    Please Login or Register  to view this content.
    And still not working. It adds the formula in column c and its a "normal" formula not an Array. And give me
    Error code: Runtime error 1004 "autofill method in ranged class failed"

    This code should be added to the sheet when i create it with VBA. Sheet name "samman"

    Will not be able to reply to any response until tomorrow sadly.
    Any Help or hints to work around this annoying problem is appreciated

    Regards Zeroaim

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Autofill FormulaArray with vba

    I believe you can just do:
    Please Login or Register  to view this content.

  3. #3
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Autofill FormulaArray with vba

    Do you add the formula to column C or B?

  4. #4
    Registered User
    Join Date
    11-13-2013
    Location
    Trollhättan, Sweden
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: Autofill FormulaArray with vba

    Yudlugar: Think ive tried it before but i tried again and got runtime error. Formula property Array can not be specified for the class range (google translated ).
    A question about the formula. You added a R into the formula when excel just use C[-1]. Does it have any change on the outcome or can you skip it when you want to look in the whole column?

    Izandol: This formula i want in the B column. Got more for C and D columns, but thats after i get the formula to work for B.

  5. #5
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Autofill FormulaArray with vba

    You receive an error with the FormulaArray if there is a problem with the formula - such as no Data sheet. The Autofill will fail if the cells are not empty. You may try:
    Please Login or Register  to view this content.
    Last edited by Izandol; 12-06-2013 at 04:08 AM.

  6. #6
    Registered User
    Join Date
    11-13-2013
    Location
    Trollhättan, Sweden
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: Autofill FormulaArray with vba

    Izandol

    The formula works when i manually enter it and hit CSE. And regarding the autofill, The sheet is created when i hit the button.
    It enters text into A1:D1 and formats column B,C,D with [h]:mm formating rest is clean.

  7. #7
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Autofill FormulaArray with vba

    May you provide the whole code? The portion you have provided runs here without problems.

  8. #8
    Registered User
    Join Date
    11-13-2013
    Location
    Trollhättan, Sweden
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: Autofill FormulaArray with vba

    Sure

    Please Login or Register  to view this content.
    If you want something translated let me know

  9. #9
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Autofill FormulaArray with vba

    FormulaArray should be entered to one cell and use comma notation with escaped quotation marks:
    Please Login or Register  to view this content.
    It will be slow calculation with whole columns however!

  10. #10
    Registered User
    Join Date
    11-13-2013
    Location
    Trollhättan, Sweden
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: Autofill FormulaArray with vba

    Thanks Izandol for all the help.
    Just have to trim the range alot

+ 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. VBA FormulaArray
    By jadown in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-19-2013, 11:52 AM
  2. [SOLVED] FormulaArray
    By GreyBates in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-05-2013, 04:56 PM
  3. [SOLVED] FormulaArray autofill doesn't show correct value
    By scott.s.fower in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-05-2012, 07:04 PM
  4. FormulaArray
    By efernandes67 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-29-2011, 06:32 PM
  5. Using FormulaArray in VBA
    By marcelobf in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-03-2006, 04:50 PM

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