P
Pete at Sappi Fine Paper
I have a chart showing delivery performance for a truck carrier. The chart
is updated by means of a program, which pulls in data based on what carrier
has been selected in another tab. It all works fine except for one thing:
the chart title, having been set by a line in the code, reverts back to the
original title as soon as another chart or cell is selected.
To begin with, the chart title is "Carrier1 On Time Performance".
My code then says:
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.ChartTitle.Select
Selection.Font.Size = 8
Selection.Characters.Text = "Carrier2 On Time Performance"
Range("A1").Select
When I run this code, I see the chart title briefly change to "Carrier2 On
Time Performance", but as soon as cell A1 is selected, it changes back to
"Carrier1 On Time Performance".
Any idea why this is happening? It is driving me crazy. Charts 2 and 3
have similar titles and code, but they do not have this problem. Once the
program is run, charts 2 and 3 show Carrier2, but chart 1 still shows
Carrier1. If I go into the title manually and change it to Carrier2, the
change sticks. So why won't it stick when the code does it?
Any help you could provide would be much appreciated - thanks!
is updated by means of a program, which pulls in data based on what carrier
has been selected in another tab. It all works fine except for one thing:
the chart title, having been set by a line in the code, reverts back to the
original title as soon as another chart or cell is selected.
To begin with, the chart title is "Carrier1 On Time Performance".
My code then says:
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.ChartTitle.Select
Selection.Font.Size = 8
Selection.Characters.Text = "Carrier2 On Time Performance"
Range("A1").Select
When I run this code, I see the chart title briefly change to "Carrier2 On
Time Performance", but as soon as cell A1 is selected, it changes back to
"Carrier1 On Time Performance".
Any idea why this is happening? It is driving me crazy. Charts 2 and 3
have similar titles and code, but they do not have this problem. Once the
program is run, charts 2 and 3 show Carrier2, but chart 1 still shows
Carrier1. If I go into the title manually and change it to Carrier2, the
change sticks. So why won't it stick when the code does it?
Any help you could provide would be much appreciated - thanks!