+ Reply to Thread
Results 1 to 7 of 7

FormulaArray autofill doesn't show correct value

  1. #1
    Valued Forum Contributor
    Join Date
    11-20-2012
    Location
    Seattle, WA USA
    MS-Off Ver
    Excel 2010
    Posts
    597

    FormulaArray autofill doesn't show correct value

    The VBA code correctly inputs the formula into the desired cell but when it autofills to desired destination the value showing is the same as in cell G7. If I manually go to the cells and F2 then Ctrl+Shift+Enter the correct value shows up

    Please Login or Register  to view this content.
    Last edited by scott.s.fower; 12-05-2012 at 03:38 PM.

  2. #2
    Forum Contributor
    Join Date
    02-15-2010
    Location
    Everett, WA
    MS-Off Ver
    All versions; most components
    Posts
    188

    Re: FormulaArray autofill doesn't show correct value

    Are the formulas in each cell right (containing proper relative cell references) and just the values are wrong? If so, the worksheet isn't calculating after you fill the formulas, probably meaning that calculation is set to Manual. You can either set back to autocalculate or you can calculate via the ribbon or in you macro:

    Please Login or Register  to view this content.

  3. #3
    Valued Forum Contributor
    Join Date
    11-20-2012
    Location
    Seattle, WA USA
    MS-Off Ver
    Excel 2010
    Posts
    597

    Re: FormulaArray autofill doesn't show correct value

    Thankyou, that was it, somehow the global setting in Excel were set to manual calculation, I changed it back to auto.
    I will remember the ActiveSheet.Calculate though.

  4. #4
    Valued Forum Contributor
    Join Date
    11-20-2012
    Location
    Seattle, WA USA
    MS-Off Ver
    Excel 2010
    Posts
    597

    Re: FormulaArray autofill doesn't show correct value

    I did solve the problem another way that circumvents the calculation problem by using a loop
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    02-15-2010
    Location
    Everett, WA
    MS-Off Ver
    All versions; most components
    Posts
    188

    Re: FormulaArray autofill doesn't show correct value

    With Application
    CalcMode = .Calculation
    .Calculation = xlCalculationManual
    .ScreenUpdating = False
    End With
    That's where you're setting to manual calculation. Just setting back to auto, like at the end of your code, doesn't force calculation until the NEXT time something changes.

  6. #6
    Valued Forum Contributor
    Join Date
    11-20-2012
    Location
    Seattle, WA USA
    MS-Off Ver
    Excel 2010
    Posts
    597

    Re: FormulaArray autofill doesn't show correct value

    Ok, thanks, can I just add Calculate to the end of that section to force calculation? because the next lines of code will copy and paste special values, if there are some formulas that aren't calculated they will be pasted as values with the incorrect value

  7. #7
    Forum Contributor
    Join Date
    02-15-2010
    Location
    Everett, WA
    MS-Off Ver
    All versions; most components
    Posts
    188

    Re: FormulaArray autofill doesn't show correct value

    Yep, just do the ActiveSheet.Calculate before the copy/paste and you should be good.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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