I have a Bubble chart that I am trying to add "motion" to by having a macro update the table and subsequently the chart. I have a cell that I use as the "offset" which is used by my data table to get the data. I have a button that runs a VBA macro that updates this "offset" cell for each month in my data, which updates the data table when the offset updates.
When I alter the offset cell manually, both the table and chart update. However, when I click the button and run the VBA macro, only the table updates, NOT the graph.
I have looked researched possible solution, including those items located here on Stack Overflow, and have tried the following:
-DoEvents
-Applications.Calculate
-ActiveWorkbook.RefreshAll
-Chart.Refresh
-setting the Application.ScreenUpdating to false and back to true
Here is my VBA code:
Sub Button7_Click()
Dim i As Integer
For i = 0 To 9:
Range("P1").Value = i
Application.Calculate
Application.Wait DateAdd("s", 1, Now)
Next
Range("P1").Value = 0
End Sub
It shouldn't be this hard to update a graph when the table updates via VBA.