Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Legend moves across chart

I have a line chart. When I change some specific values, a
macro is executed automatically. It changes the minimum and
maximum values on the horizontal axis, and also the number
format:
..MinimumScale=...
..MaximumScale=...
..TickLabels.NumberFormat=...

But then, the rectangle containing the legends moves. A few
pixels up, or to the left. Every time.

In the Format Legent screen, Placement tab, "Right" is
marked, and stays marked.

I suppose the macro is responsible, but I am not sure. How
do I fix that ?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Legend moves across chart

Sinus Log wrote:
I have a line chart. When I change some specific values, a macro is
executed automatically. It changes the minimum and maximum values on the
horizontal axis, and also the number format:
.MinimumScale=...
.MaximumScale=...
.TickLabels.NumberFormat=...

But then, the rectangle containing the legends moves. A few pixels up,
or to the left. Every time.

In the Format Legent screen, Placement tab, "Right" is marked, and stays
marked.

I suppose the macro is responsible, but I am not sure. How do I fix that ?



Small error I made in my first post: it's an XY (Scatter) chart.
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,489
Default Legend moves across chart

Hi,

I could not reproduce the problem from your description, although I have
seen it in the past.

Why not read the top and left properties of the legend at the beginning
of your macro and set them at the end if they have changed.

Cheers
Andy

Sinus Log wrote:
I have a line chart. When I change some specific values, a macro is
executed automatically. It changes the minimum and maximum values on the
horizontal axis, and also the number format:
.MinimumScale=...
.MaximumScale=...
.TickLabels.NumberFormat=...

But then, the rectangle containing the legends moves. A few pixels up,
or to the left. Every time.

In the Format Legent screen, Placement tab, "Right" is marked, and stays
marked.

I suppose the macro is responsible, but I am not sure. How do I fix that ?


--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,489
Default Legend moves across chart

Hi,

Can you email me the file, do not attached to this newsgroup.

I haven't seen this when the numbers in cells where modified and as I
said I can not get you code to re create the problem.

Cheers
Andy

Sinus Log wrote:
Andy Pope wrote:

Hi,

I could not reproduce the problem from your description, although I
have seen it in the past.

Why not read the top and left properties of the legend at the
beginning of your macro and set them at the end if they have changed.

Cheers
Andy


How do I do that ? It took me a couple of hours to figure out how to
program the number format. Could you tell me how to modify my code,
please ?
With graphique.Chart.Axes(xlCategory)
.MinimumScale = premPointComp
.MaximumScale = dernPointComp
.TickLabels.NumberFormat = formatNombres
End With

Thanks for your reply

PS: More on the symptoms
There's no problem until the macro is executed. The problem shows
afterwards when I modify a cell, even if that doesn't trigger the macro.


--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Legend moves across chart

Andy Pope wrote:
Hi,

I could not reproduce the problem from your description, although I have
seen it in the past.

Why not read the top and left properties of the legend at the beginning
of your macro and set them at the end if they have changed.

Cheers
Andy


How do I do that ? It took me a couple of hours to figure
out how to program the number format. Could you tell me how
to modify my code, please ?
With graphique.Chart.Axes(xlCategory)
.MinimumScale = premPointComp
.MaximumScale = dernPointComp
.TickLabels.NumberFormat = formatNombres
End With

Thanks for your reply

PS: More on the symptoms
There's no problem until the macro is executed. The problem
shows afterwards when I modify a cell, even if that doesn't
trigger the macro.


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Legend moves across chart

Andy Pope wrote:
Hi,

Can you email me the file, do not attached to this newsgroup.

I haven't seen this when the numbers in cells where modified and as I
said I can not get you code to re create the problem.

Cheers
Andy

Sinus Log wrote:
Andy Pope wrote:

Hi,

I could not reproduce the problem from your description, although I
have seen it in the past.

Why not read the top and left properties of the legend at the
beginning of your macro and set them at the end if they have changed.

Cheers
Andy


How do I do that ? It took me a couple of hours to figure out how to
program the number format. Could you tell me how to modify my code,
please ?
With graphique.Chart.Axes(xlCategory)
.MinimumScale = premPointComp
.MaximumScale = dernPointComp
.TickLabels.NumberFormat = formatNombres
End With

Thanks for your reply

PS: More on the symptoms
There's no problem until the macro is executed. The problem shows
afterwards when I modify a cell, even if that doesn't trigger the macro.



Thanks, Andy
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Chart moves on plot area when adding a third month Melody Charts and Charting in Excel 2 March 15th 10 01:13 PM
position of chart on page moves when outline expands Harold Good Charts and Charting in Excel 2 September 21st 09 07:24 PM
add legend to chart T.H Charts and Charting in Excel 1 July 30th 09 10:53 AM
Bar Chart Legend Key Certior Charts and Charting in Excel 3 September 26th 07 03:51 PM
chart legen moves! [email protected] Charts and Charting in Excel 5 April 28th 06 08:14 PM


All times are GMT +1. The time now is 08:58 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"