+ Reply to Thread
Results 1 to 27 of 27

Formula Array not adjusting to range

  1. #1
    Registered User
    Join Date
    09-24-2013
    Location
    United States
    MS-Off Ver
    Excel 2007 & 2013
    Posts
    70

    Formula Array not adjusting to range

    Please Login or Register  to view this content.
    I have this code and its working great but only on the first line. I need on B4 the last part to be
    Please Login or Register  to view this content.
    and
    Please Login or Register  to view this content.
    on B5 and so forth. Is there a way to get it to do this?
    Last edited by LightHeart7; 11-22-2013 at 01:57 PM.

  2. #2
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Formula Array not adjusting to range

    Hi,

    Perhaps you'd be kind enough to give some feedback on some of your other (unfinished) threads before starting a new one? Especially since the formula in this post seems to be almost identical to the one in the other, and also considering I put a not insignificant amount of time into trying to help you in that other post.

    http://www.excelforum.com/excel-form...ank-cells.html

    Regards
    Last edited by XOR LX; 11-20-2013 at 11:21 AM.
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  3. #3
    Registered User
    Join Date
    09-24-2013
    Location
    United States
    MS-Off Ver
    Excel 2007 & 2013
    Posts
    70

    Re: Formula Array not adjusting to range

    I know formulas will work down the range so how can I get this one to? Its important that I'm getting it got come down A1 to A2 to A3 etc.
    Last edited by LightHeart7; 11-22-2013 at 11:24 AM.

  4. #4
    Registered User
    Join Date
    09-24-2013
    Location
    United States
    MS-Off Ver
    Excel 2007 & 2013
    Posts
    70

    Re: Formula Array not adjusting to range

    This has to be an array. I've seen brief mentions of this.. R1C1? I'm not sure. I couldn't just use this in a regular cell because overall i'm going to have so many its too much for the cell itself. maybe another method to get through this?

  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: Formula Array not adjusting to range

    You must fill:
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    09-24-2013
    Location
    United States
    MS-Off Ver
    Excel 2007 & 2013
    Posts
    70

    Re: Formula Array not adjusting to range

    I'm getting an error unfortunately. "Unable to set the FormulaArray property of the Range Class". Did I miss something? I know I have it under a macro type.

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

    Re: Formula Array not adjusting to range

    .formulaarray has to be r1c1 references.
    Please Login or Register  to view this content.
    I'm not 100% you can use the workaround in the second line without looping, either loop through each cell or re-write your formula with r1c1 references and assign to the whole ranges formulaarray property.

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

    Re: Formula Array not adjusting to range

    Which version are you using - I have tested in 2013 without problem.

  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: Formula Array not adjusting to range

    FormulaArray does not require R1C1 references.

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

    Re: Formula Array not adjusting to range

    @Izandol,

    It does in 2003... From the help file:
    FormulaArray Property
    See AlsoApplies ToExampleSpecificsReturns or sets the array formula of a range. Returns (or can be set to) a single formula or a Visual Basic array. If the specified range doesn't contain an array formula, this property returns Null. Read/write Variant.

    Remarks
    If you use this property to enter an array formula, the formula must use the R1C1 reference style, not the A1 reference style (see the second example).

    Example
    This example enters the number 3 as an array constant in cells A1:C5 on Sheet1.

    Worksheets("Sheet1").Range("A1:C5").FormulaArray = "=3"

    This example enters the array formula =SUM(R1C1:R3C3) in cells E1:E3 on Sheet1.

    Worksheets("Sheet1").Range("E1:E3").FormulaArray = _
    "=Sum(R1C1:R3C3)"

    Edit: checked msdn for later versions and seems the same?
    Last edited by ragulduy; 11-22-2013 at 12:30 PM.

  11. #11
    Registered User
    Join Date
    09-24-2013
    Location
    United States
    MS-Off Ver
    Excel 2007 & 2013
    Posts
    70

    Re: Formula Array not adjusting to range

    Oh, I should remember to mention which version. For this one I'm using 2013. For more information this is what is calling the Macro
    Please Login or Register  to view this content.
    I'm still getting that error though. Perhaps i'm doing something off. Again I'm using just
    Please Login or Register  to view this content.

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

    Re: Formula Array not adjusting to range

    The Help file is incorrect in this regard.

  13. #13
    Registered User
    Join Date
    09-24-2013
    Location
    United States
    MS-Off Ver
    Excel 2007 & 2013
    Posts
    70

    Re: Formula Array not adjusting to range

    I know this isn't the easiest thing to work with. I can't thank you guys enough though for trying to work with me on this!

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

    Re: Formula Array not adjusting to range

    @Izandol,

    I'd be interested on your thoughts on this thread:
    http://www.excelforum.com/excel-prog...la-in-vba.html

    It's one that stuck out in my mind that the r1c1 thing seemed to fix...

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

    Re: Formula Array not adjusting to range

    Can you provide a workbook? The code works in my copy of 2013.

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

    Re: Formula Array not adjusting to range

    Just about to leave for the weekend, will try and remember on monday.

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

    Re: Formula Array not adjusting to range

    @yudlugar,

    I think my interpretation of that thread is different from yours; it seems the formula string was simply too long because the external:=true parameter of the Address property was including the workbook name as well as the worksheet name and both FormulaArray and Evaluate require a formula string below 255 characters.

    I do not think it will take you long to test this.

  18. #18
    Registered User
    Join Date
    09-24-2013
    Location
    United States
    MS-Off Ver
    Excel 2007 & 2013
    Posts
    70

    Re: Formula Array not adjusting to range

    I'm getting another error this time. Error: -2147417848(80010108) method 'formulaarray' of object 'range' failed

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

    Re: Formula Array not adjusting to range

    I think you must provide a workbook. The code does work here.

  20. #20
    Registered User
    Join Date
    09-24-2013
    Location
    United States
    MS-Off Ver
    Excel 2007 & 2013
    Posts
    70

    Re: Formula Array not adjusting to range

    Is.. it possible its doing this because it finds 2 and then the rest are "#num!"?

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

    Re: Formula Array not adjusting to range

    I do not think so because my testing was performed in a blank workbook and so each formula returned #NUM.

  22. #22
    Registered User
    Join Date
    09-24-2013
    Location
    United States
    MS-Off Ver
    Excel 2007 & 2013
    Posts
    70

    Re: Formula Array not adjusting to range

    Here is a mock up. Its a bit odd, its seems to be freezing up a bit or having glitchs.
    Attached Files Attached Files
    Last edited by LightHeart7; 11-22-2013 at 01:14 PM.

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

    Re: Formula Array not adjusting to range

    I believe that workbook may be corrupt because it behaves very strangely.

  24. #24
    Registered User
    Join Date
    09-24-2013
    Location
    United States
    MS-Off Ver
    Excel 2007 & 2013
    Posts
    70

    Re: Formula Array not adjusting to range

    If you go directly into the codes and delete them, it doesn't act all weird. it was something in the code set up maybe?.. I've had this on and off when playing with the code and that was a brand new workbook.

  25. #25
    Registered User
    Join Date
    09-24-2013
    Location
    United States
    MS-Off Ver
    Excel 2007 & 2013
    Posts
    70

    Re: Formula Array not adjusting to range

    If you're wondering, I will be putting another formula for C4:C8 in the next one over but instead of the original A:A on on the first column in the formula it will be B:B

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

    Re: Formula Array not adjusting to range

    It is my mistake - you must disable events when autofilling:
    Please Login or Register  to view this content.

  27. #27
    Registered User
    Join Date
    09-24-2013
    Location
    United States
    MS-Off Ver
    Excel 2007 & 2013
    Posts
    70

    Re: Formula Array not adjusting to range

    Oh! Well i didn't divulge everything. Oooh Its working! Thank you thank you!!! This has been such a pain in my side. I'm so happy!

+ 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. The formula is not adjusting to the fluctuating range automatically
    By geoffrey22 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-28-2013, 10:05 AM
  2. Print Range for Pivot Table Adjusting Range
    By mmicfinance in forum Excel General
    Replies: 0
    Last Post: 08-08-2012, 01:55 PM
  3. Replies: 2
    Last Post: 12-22-2011, 07:05 PM
  4. [SOLVED] Adjusting a formula cell range
    By Jamie in forum Excel General
    Replies: 1
    Last Post: 05-26-2006, 12:10 PM
  5. Replies: 0
    Last Post: 07-27-2005, 11:05 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