+ Reply to Thread
Results 1 to 5 of 5

Excel Chart not Updating after Macro (Automatic is turned on)

  1. #1
    Registered User
    Join Date
    05-16-2017
    Location
    New York
    MS-Off Ver
    2016
    Posts
    27

    Excel Chart not Updating after Macro (Automatic is turned on)

    I have a chart that does not updated after I run a macro to expand/collapse grouped rows. If I expand and collapse them manually it works fine and the chart appears fine.

    Automatic calculation is turned on. The odd thing is, if I just delete a random row in the workbook, or hide/unhide random rows, the chart refreshes and the data selection series go back to what they should be instead of #VALUE!. I tried adding deleting a random row to my macro, but still nothing.

    Here is what I have in my macro -

    Function CountCcolor(range_data As Range, criteria As Range) As Long
    Dim datax As Range
    Dim xcolor As Long
    xcolor = criteria.Interior.ColorIndex
    For Each datax In range_data
    If datax.Interior.ColorIndex = xcolor Then
    CountCcolor = CountCcolor + 1
    End If
    Next datax
    End Function

    Sub Expand_All()
    ActiveSheet.Outline.ShowLevels RowLevels:=2
    Application.Calculate
    End Sub

    Sub collapse()
    ActiveSheet.Outline.ShowLevels RowLevels:=1
    Application.Calculate
    End Sub


    Any help appreciated. Thanks
    Attached Files Attached Files
    Last edited by scotth73; 05-17-2017 at 08:26 AM.

  2. #2
    Registered User
    Join Date
    05-16-2017
    Location
    New York
    MS-Off Ver
    2016
    Posts
    27

    Re: Excel Chart not Updating after Macro (Automatic is turned on)

    Workbook added to post

  3. #3
    Registered User
    Join Date
    05-16-2017
    Location
    New York
    MS-Off Ver
    2016
    Posts
    27

    Re: Excel Chart not Updating after Macro (Automatic is turned on)

    Bumping...........

  4. #4
    Valued Forum Contributor
    Join Date
    10-05-2014
    Location
    Regina, SK Canada
    MS-Off Ver
    Excel for Mac 11
    Posts
    330

    Re: Excel Chart not Updating after Macro (Automatic is turned on)

    Here's the catch with using a macro…
    Running it does not normally tell Excel if any cells were changed
    You have to force that

    Try adding this line to the end of your macro.

    Please Login or Register  to view this content.
    If this has been helpful, please click on the star at the left.

  5. #5
    Registered User
    Join Date
    05-16-2017
    Location
    New York
    MS-Off Ver
    2016
    Posts
    27

    Re: Excel Chart not Updating after Macro (Automatic is turned on)

    Thank you StuCram. I added the line but still does not update automatically.

+ 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. Excel 2016 screen flashing between two workbooks despite screen updating turned off
    By Cumberland in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-29-2016, 03:07 PM
  2. [SOLVED] Excel 2007: fomratting/ automatic updating of plots
    By Sunlandian in forum Excel General
    Replies: 5
    Last Post: 01-16-2015, 04:53 PM
  3. [SOLVED] Formulas not calculating, Automatic is turned on!
    By rikkyshh in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-24-2013, 10:43 AM
  4. Email excel workbook and automatic updating
    By andymcnichol in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-26-2013, 08:26 PM
  5. Excel Formulas Not Updating, Workbook Calc Set to Automatic
    By chicagoland8 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-11-2012, 10:38 AM
  6. Help with automatic chart updating/auto updating today function
    By Tux2424 in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 09-26-2012, 04:45 PM
  7. Replies: 3
    Last Post: 05-20-2010, 12:37 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