excel vba - vba legend and plot area resizing -


I have an Excel chart that changes to the selections made in the slicer I saw the plot made in the legend field The change happens based on the selection.

I tried to fix the situation and size for the plot area, but it does not work unfortunately.

Plot area and mythology are on resizing, from which mythology is overlapping. Which I do not want explicitly

I have placed this code in the worksheet page of VBA editor.

  option clear Private sub Chart_Calculate () ChartObjects ("grafiek 4"). Active ActiveChart.PlotArea.Width = 637.783 ActiveChart.Legend.Left = 716.514 ActiveChart.Legend.Width = 176.735 ActiveChart.Legend.Height = 295.334 End Sub  

In this code, I think Automatic resizing will work, but I noticed that the legend sometimes overlaps the area still objectionable.

Is there a solution that fixes this problem permanently?

Edit1:

Tomorrow, I have added some parameters to the conspiracy area. It seemed to work then but now I tried again, and the plot is overlapping the conspiracy area again.

I have changed the code to: (Grafiek

  Options Private Private Chart_Calculate () ChartObjects "4"). Active ActiveChart.PlotArea.Top = 33.102 ActiveChart.PlotArea.Left = 67.1 ActiveChart.PlotArea.Width = 637.783 ActiveChart.Legend.Top = 7 ActiveChart.Legend.Left = 716.514 ActiveChart.Legend.Width = 176.735 for ActiveChart.Legend plot area With 2 more parameters.  

edit2: I've checked in Legend's properties in Excel. There is a checkbox under 'Options for legend': Show legend without overlapping plot area (I do not know exact English text) This box is checked, but it overlaps the plot area.

Why is it impossible to achieve this? There should be fixed size for plot area and the story should not be done so hard. Click

3: in my workbook is now routine:

  Options Clear Private Sub Chart_Calculate () ChartObjects ( "grafiek 4") . .Legend .IncludeInLayout = True = 637.783 end with active .PlotArea .Top = 33.102 .Left = 67.1 .Width with ActiveChart with .position = xlLegendPositionRight. AutoScaleFont = false .Font.Size = 8 .Top = 5 .Left = 706.899 .Width = 179.735 .Height End Sub Sub = 336.681 and (with the end with kopieergrafiek) ActiveSheet.ChartObjects ( "Grafiek 4"). Copy End Sub  

(Includes Suggestion in the comment below my post)

I do not think the worksheet_check event probably works better?

Edit 4: I still do not have a solution to this problem, it is already done when 1 in the mythological space is long enough to fit in space . And it also happens when there are many things to fit in the available space.

I think there is no solution for this. Unless I can say in some way to maximize the number of objects in the legend say excel or to maximize the length of the name of the series.

plot area. I tried, which suggested the Portland runner, only setting. Include in this for lying (thus he separates legend from the alleged area as he has suggested, perhaps he made a typo?) And my plot area is no longer resized.


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -