A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Charts and Charting
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Chart not updating with changes in source data



 
 
Thread Tools Display Modes
  #1  
Old May 26th, 2008, 05:04 AM posted to microsoft.public.excel.charting
Geoff
external usenet poster
 
Posts: 212
Default Chart not updating with changes in source data

I have a chart which has 4 columns of source data (150 rows each) on another
worksheet. Users can manipulate the values in the source data by selecting an
option in a combo box which is linked to a cell on the same sheet as the
source data. Calculation is set to Automatic, and the source data updates
fine. However, the chart does not update with changes to the source data.
I've tried using F9, Ctrl + Alt + F9, Ctrl + Shift + Alt + F9 etc., but the
only way to get the chart up to date at this point is either to delete the
graph and recreate it, or to save the workbook, close and reopen it. Both of
these methods work but are obviously far from ideal.

I have noticed that the statusbar has Calculate on it, which I seem to
recall indicates that some things in the workbook have not calculated
completely. I have tried putting Application.Calculate and
Application.CalculateFullRebuild in the combo box's change event but this
does nothing to resolve the situation.

Any ideas?
TIA for any suggestions
--
There are 10 types of people in the world - those who understand binary and
those who don't.
  #2  
Old May 26th, 2008, 12:36 PM posted to microsoft.public.excel.charting
Bernard Liengme
external usenet poster
 
Posts: 4,085
Default Chart not updating with changes in source data

Perhaps this message belongs in the Programming newsgroup. But it would help
to see the code. Maybe there is something there stopping the chart update.
When I do animation with chart I always add the statement Do Events
right after VBA has made changes to the data on the worksheet used for the
chart.
--
Bernard Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme



"Geoff" wrote in message
...
I have a chart which has 4 columns of source data (150 rows each) on
another
worksheet. Users can manipulate the values in the source data by selecting
an
option in a combo box which is linked to a cell on the same sheet as the
source data. Calculation is set to Automatic, and the source data updates
fine. However, the chart does not update with changes to the source data.
I've tried using F9, Ctrl + Alt + F9, Ctrl + Shift + Alt + F9 etc., but
the
only way to get the chart up to date at this point is either to delete the
graph and recreate it, or to save the workbook, close and reopen it. Both
of
these methods work but are obviously far from ideal.

I have noticed that the statusbar has Calculate on it, which I seem to
recall indicates that some things in the workbook have not calculated
completely. I have tried putting Application.Calculate and
Application.CalculateFullRebuild in the combo box's change event but this
does nothing to resolve the situation.

Any ideas?
TIA for any suggestions
--
There are 10 types of people in the world - those who understand binary
and
those who don't.


  #3  
Old May 26th, 2008, 10:15 PM posted to microsoft.public.excel.charting
Geoff
external usenet poster
 
Posts: 212
Default Chart not updating with changes in source data

Hi Bernard, thanks for the response. Should I cross-post this to the
Programming group?

Below is the code I use to update the source data - I have now attached it
to a command button ('Recalculate'), so the user selects the relevant
parameters in the comboboxes and then presses this button to activate the
change process.

Private Sub Recalculate_Click()
Dim primeCourt As String
Dim secCourt As String
Dim i As Long
Dim j As Long
Dim Courts As Range
Dim Lookup As Worksheet
Dim cell As Range
Dim daysRng As String
Dim ratesRng As String

Set Lookup = ThisWorkbook.Worksheets("WhatIf Lookup")
With Lookup
Set Courts = .Range("Whatif_ct_list")
primeCourt = Court_Prime_Select.Value
i = Application.WorksheetFunction.Match(primeCourt, Courts, 0)
secCourt = Court_Sec_Select.Value
j = Application.WorksheetFunction.Match(secCourt, Courts, 0)
Select Case .Range("Whatif_Stage")
Case 1
daysRng = "Admin_Days_"
ratesRng = "Admin_Rates_"
Case 2
daysRng = "PT_Days_"
ratesRng = "PT_Rates_"
Case 3
daysRng = "Deps_Days_"
ratesRng = "Deps_Rates_"
Case Else
Exit Sub
End Select
Set cell = .Range("C33")
cell.FormulaArray = "=SUMPRODUCT(IF((RC2*7-(Ave_" & i & "+" & daysRng &
i & _
"))=0,IF((RC2" & "*7-(Ave_" & i & "+" & daysRng & i &
"))/7Max_Duration," & _
"Weekly_New" & i & ",0),0)," & ratesRng & i & ")"
.Range(cell, cell.Offset(150, 0)).FillDown
Set cell = .Range("D33")
cell.FormulaArray = "=SUMPRODUCT(IF((RC2*7-(Ave_" & j & "+" & daysRng &
j & _
"))=0,IF((RC2" & "*7-(Ave_" & j & "+" & daysRng & j &
"))/7=Max_Duration," & _
"Weekly_New" & i & ",0),0)," & ratesRng & j & ")"
.Range(cell, cell.Offset(150, 0)).FillDown
Set cell = .Range("F33")
cell.FormulaR1C1 = "=R[-1]C+Weekly_New" & i & "-RC[-1]"
.Range(cell, cell.Offset(150, 0)).FillDown
.Calculate
End With
Application.Calculate
DoEvents

End Sub

I have stepped through the code, and it executes ok - as before, the source
data changes exactly the way it should. The chart, however, remains unmoved
: As you can see, I've added the DoEvents statement in, but there has been

no change to the chart as a result.

Thanks
Geoff
--
There are 10 types of people in the world - those who understand binary and
those who don't.


"Bernard Liengme" wrote:

Perhaps this message belongs in the Programming newsgroup. But it would help
to see the code. Maybe there is something there stopping the chart update.
When I do animation with chart I always add the statement Do Events
right after VBA has made changes to the data on the worksheet used for the
chart.
--
Bernard Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme



"Geoff" wrote in message
...
I have a chart which has 4 columns of source data (150 rows each) on
another
worksheet. Users can manipulate the values in the source data by selecting
an
option in a combo box which is linked to a cell on the same sheet as the
source data. Calculation is set to Automatic, and the source data updates
fine. However, the chart does not update with changes to the source data.
I've tried using F9, Ctrl + Alt + F9, Ctrl + Shift + Alt + F9 etc., but
the
only way to get the chart up to date at this point is either to delete the
graph and recreate it, or to save the workbook, close and reopen it. Both
of
these methods work but are obviously far from ideal.

I have noticed that the statusbar has Calculate on it, which I seem to
recall indicates that some things in the workbook have not calculated
completely. I have tried putting Application.Calculate and
Application.CalculateFullRebuild in the combo box's change event but this
does nothing to resolve the situation.

Any ideas?
TIA for any suggestions
--
There are 10 types of people in the world - those who understand binary
and
those who don't.



  #4  
Old March 3rd, 2010, 04:34 AM posted to microsoft.public.excel.charting
the boffer
external usenet poster
 
Posts: 1
Default fix found

This may help you, since I was trying all sorts of odd things. Turns out the excel file I had inherited had the calculation set to MANUAL. When setting this to automatic, everytime you change the sorce data, the chart updates! It makes no difference if the excel file has macros or not.

in excel 2003:
tools - options - calculation tab - set calculation to automatic


Good or good?



Geof wrote:

Hi Bernard, thanks for the response.
26-May-08

Hi Bernard, thanks for the response. Should I cross-post this to the
Programming group?

Below is the code I use to update the source data - I have now attached it
to a command button ('Recalculate'), so the user selects the relevant
parameters in the comboboxes and then presses this button to activate the
change process.

Private Sub Recalculate_Click()
Dim primeCourt As String
Dim secCourt As String
Dim i As Long
Dim j As Long
Dim Courts As Range
Dim Lookup As Worksheet
Dim cell As Range
Dim daysRng As String
Dim ratesRng As String

Set Lookup = ThisWorkbook.Worksheets("WhatIf Lookup")
With Lookup
Set Courts = .Range("Whatif_ct_list")
primeCourt = Court_Prime_Select.Value
i = Application.WorksheetFunction.Match(primeCourt, Courts, 0)
secCourt = Court_Sec_Select.Value
j = Application.WorksheetFunction.Match(secCourt, Courts, 0)
Select Case .Range("Whatif_Stage")
Case 1
daysRng = "Admin_Days_"
ratesRng = "Admin_Rates_"
Case 2
daysRng = "PT_Days_"
ratesRng = "PT_Rates_"
Case 3
daysRng = "Deps_Days_"
ratesRng = "Deps_Rates_"
Case Else
Exit Sub
End Select
Set cell = .Range("C33")
cell.FormulaArray = "=SUMPRODUCT(IF((RC2*7-(Ave_" & i & "+" & daysRng &
i & _
"))=0,IF((RC2" & "*7-(Ave_" & i & "+" & daysRng & i &
"))/7Max_Duration," & _
"Weekly_New" & i & ",0),0)," & ratesRng & i & ")"
.Range(cell, cell.Offset(150, 0)).FillDown
Set cell = .Range("D33")
cell.FormulaArray = "=SUMPRODUCT(IF((RC2*7-(Ave_" & j & "+" & daysRng &
j & _
"))=0,IF((RC2" & "*7-(Ave_" & j & "+" & daysRng & j &
"))/7=Max_Duration," & _
"Weekly_New" & i & ",0),0)," & ratesRng & j & ")"
.Range(cell, cell.Offset(150, 0)).FillDown
Set cell = .Range("F33")
cell.FormulaR1C1 = "=R[-1]C+Weekly_New" & i & "-RC[-1]"
.Range(cell, cell.Offset(150, 0)).FillDown
.Calculate
End With
Application.Calculate
DoEvents

End Sub

I have stepped through the code, and it executes ok - as before, the source
data changes exactly the way it should. The chart, however, remains unmoved
no change to the chart as a result.

Thanks
Geoff
--
There are 10 types of people in the world - those who understand binary and
those who don't.


"Bernard Liengme" wrote:

Previous Posts In This Thread:

On Monday, May 26, 2008 12:04 AM
Geof wrote:

Chart not updating with changes in source data
I have a chart which has 4 columns of source data (150 rows each) on another
worksheet. Users can manipulate the values in the source data by selecting an
option in a combo box which is linked to a cell on the same sheet as the
source data. Calculation is set to Automatic, and the source data updates
fine. However, the chart does not update with changes to the source data.
I've tried using F9, Ctrl + Alt + F9, Ctrl + Shift + Alt + F9 etc., but the
only way to get the chart up to date at this point is either to delete the
graph and recreate it, or to save the workbook, close and reopen it. Both of
these methods work but are obviously far from ideal.

I have noticed that the statusbar has Calculate on it, which I seem to
recall indicates that some things in the workbook have not calculated
completely. I have tried putting Application.Calculate and
Application.CalculateFullRebuild in the combo box's change event but this
does nothing to resolve the situation.

Any ideas?
TIA for any suggestions
--
There are 10 types of people in the world - those who understand binary and
those who don't.

On Monday, May 26, 2008 7:36 AM
Bernard Liengme wrote:

Perhaps this message belongs in the Programming newsgroup.
Perhaps this message belongs in the Programming newsgroup. But it would help
to see the code. Maybe there is something there stopping the chart update.
When I do animation with chart I always add the statement Do Events
right after VBA has made changes to the data on the worksheet used for the
chart.
--
Bernard Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme



"Geoff" wrote in message
...

On Monday, May 26, 2008 5:15 PM
Geof wrote:

Hi Bernard, thanks for the response.
Hi Bernard, thanks for the response. Should I cross-post this to the
Programming group?

Below is the code I use to update the source data - I have now attached it
to a command button ('Recalculate'), so the user selects the relevant
parameters in the comboboxes and then presses this button to activate the
change process.

Private Sub Recalculate_Click()
Dim primeCourt As String
Dim secCourt As String
Dim i As Long
Dim j As Long
Dim Courts As Range
Dim Lookup As Worksheet
Dim cell As Range
Dim daysRng As String
Dim ratesRng As String

Set Lookup = ThisWorkbook.Worksheets("WhatIf Lookup")
With Lookup
Set Courts = .Range("Whatif_ct_list")
primeCourt = Court_Prime_Select.Value
i = Application.WorksheetFunction.Match(primeCourt, Courts, 0)
secCourt = Court_Sec_Select.Value
j = Application.WorksheetFunction.Match(secCourt, Courts, 0)
Select Case .Range("Whatif_Stage")
Case 1
daysRng = "Admin_Days_"
ratesRng = "Admin_Rates_"
Case 2
daysRng = "PT_Days_"
ratesRng = "PT_Rates_"
Case 3
daysRng = "Deps_Days_"
ratesRng = "Deps_Rates_"
Case Else
Exit Sub
End Select
Set cell = .Range("C33")
cell.FormulaArray = "=SUMPRODUCT(IF((RC2*7-(Ave_" & i & "+" & daysRng &
i & _
"))=0,IF((RC2" & "*7-(Ave_" & i & "+" & daysRng & i &
"))/7Max_Duration," & _
"Weekly_New" & i & ",0),0)," & ratesRng & i & ")"
.Range(cell, cell.Offset(150, 0)).FillDown
Set cell = .Range("D33")
cell.FormulaArray = "=SUMPRODUCT(IF((RC2*7-(Ave_" & j & "+" & daysRng &
j & _
"))=0,IF((RC2" & "*7-(Ave_" & j & "+" & daysRng & j &
"))/7=Max_Duration," & _
"Weekly_New" & i & ",0),0)," & ratesRng & j & ")"
.Range(cell, cell.Offset(150, 0)).FillDown
Set cell = .Range("F33")
cell.FormulaR1C1 = "=R[-1]C+Weekly_New" & i & "-RC[-1]"
.Range(cell, cell.Offset(150, 0)).FillDown
.Calculate
End With
Application.Calculate
DoEvents

End Sub

I have stepped through the code, and it executes ok - as before, the source
data changes exactly the way it should. The chart, however, remains unmoved
no change to the chart as a result.

Thanks
Geoff
--
There are 10 types of people in the world - those who understand binary and
those who don't.


"Bernard Liengme" wrote:


Submitted via EggHeadCafe - Software Developer Portal of Choice
Measuring SharePoint Page Rendering
http://www.eggheadcafe.com/tutorials...oint-page.aspx
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:42 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.