PC Review


Reply
Thread Tools Rate Thread

Chart Title Reverts Back To Previous Value

 
 
=?Utf-8?B?UGV0ZSBhdCBTYXBwaSBGaW5lIFBhcGVy?=
Guest
Posts: n/a
 
      20th Nov 2007
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!
 
Reply With Quote
 
 
 
 
=?Utf-8?B?UGV0ZSBhdCBTYXBwaSBGaW5lIFBhcGVy?=
Guest
Posts: n/a
 
      20th Nov 2007
I had a identical Chart4 stacked on top of Chart1. Chart1 was updating just
fine, then slipping behind Chart4 when deselected. D'oh!

"Pete at Sappi Fine Paper" wrote:

> 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!

 
Reply With Quote
 
paul.robinson@it-tallaght.ie
Guest
Posts: n/a
 
      20th Nov 2007
On Nov 20, 3:05 pm, Pete at Sappi Fine Paper
<PeteatSappiFinePa...@discussions.microsoft.com> wrote:
> 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!


Hi
Try this (untested)

ActiveSheet.ChartObjects("Chart 1").Activate
With ActiveChart.Chart.ChartTitle
.Font.Size = 8
.Text = "Carrier2 On Time Performance"
End with
Range("A1").Select

I think the ActiveChart is a chart object which contains the chart.

regards
Paul

 
Reply With Quote
 
=?Utf-8?B?UGV0ZSBhdCBTYXBwaSBGaW5lIFBhcGVy?=
Guest
Posts: n/a
 
      20th Nov 2007
Thanks Paul - I appreciate your response. I'm all set now, though - I had a
Chart4 sitting on top of Chart1 and this was confusing the issue.

"(E-Mail Removed)" wrote:

> On Nov 20, 3:05 pm, Pete at Sappi Fine Paper
> <PeteatSappiFinePa...@discussions.microsoft.com> wrote:
> > 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!

>
> Hi
> Try this (untested)
>
> ActiveSheet.ChartObjects("Chart 1").Activate
> With ActiveChart.Chart.ChartTitle
> .Font.Size = 8
> .Text = "Carrier2 On Time Performance"
> End with
> Range("A1").Select
>
> I think the ActiveChart is a chart object which contains the chart.
>
> regards
> Paul
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Chart data labels default back to previous formatting when save+cl Shelly Microsoft Powerpoint 3 14th Nov 2008 06:56 PM
Default view of folders reverts back to previous settings. Jeff Ingram Windows Vista File Management 28 7th Apr 2007 10:18 PM
Default view of folders reverts back to previous settings. Jeff Ingram Windows Vista General Discussion 28 7th Apr 2007 10:18 PM
doc reverts to previous version after being sent. Nobody knows why =?Utf-8?B?am9lbGdlZQ==?= Microsoft Word Document Management 2 18th Feb 2006 04:36 PM
Query reverts to previous version?!?! dofnup Microsoft Access Queries 2 14th Nov 2003 07:23 AM


Features
 

Advertising
 

Newsgroups
 


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