Reformatting a chart - Strange issue

mikejvir

Board Regular
Joined
Jan 3, 2008
Messages
95
I have a macro that does some reformatting of a chart (on it's own chart sheet) that changes adds a footer, put the plot area in a specific area (for page to page consistency), axis formatting, legend format.

My issue is that the macro must be run twice and with a manual input (Input box) to correct.

I had two major issues to begin with. One was the plot area border which was fixed with help from another Excel website. That fix was totally unexpected and it involved moving the .Format.Line.Visible setting downwards lines.

Code:
  With ActiveChart.PlotArea
    .Width = 690
    .Height = 410
    .Top = 75
    .Left = 25
'
'  Order is important.
'
    .Format.Line.Weight = borderweight + 0.5
    .Format.Line.ForeColor.RGB = RGB(0, 0, 0)
    .Format.Line.Transparency = 0
    .Interior.ColorIndex = xlNone
    .Format.Line.Visible = msoTrue  '  Move from before changing the weight

The second which I still have not figured out. I printed out Chart area (CA), plot area (PA) and inside plot area (IPA) parameter at different times through the macro.


Test 1st-Start 1st-End 2nd-Start 2nd-End
CA Top 0 0 0 0
CA Left 0 0 0 0
CA Height 495.99 495.99 502.50 502.50
CA Width 683.49 683.49 747.75 747.75
PA Top 33.09 75 76.04 75
PA Left 7 18 20.07 25
PA Height 425.03 410 415.38 410
PA Width 661.49 661.49 723.68 690
IPA Top 33.09 81.65 82.68 81.65
IPA Left 47.79 78.71 80.77 85.71
IPA Height 425.03 381.43 386.82 381.43
IPA Width 608.16 578.29 640.48 606.79



(Sorry I tried to columnize the data).
[table="width: 500, class: grid"]
[tr]
[td]Test[/td]
[td]1st-Start[/td]
[td]1st-End[/td]
[td]2nd-Start[/td]
[td]2nd-End[/td]
[/tr]
[tr]
[td]CA Top[/td]
[td]0[/td]
[td]0[/td]
[td]0[/td]
[td]0[/td]
[/tr]
[tr]
[td]CA Left[/td]
[td]0[/td]
[td]0[/td]
[td]0[/td]
[td]0[/td]
[/tr]
[tr]
[td]CA Height[/td]
[td]495.99[/td]
[td]495.99[/td]
[td]502.50[/td]
[td]502.50[/td]
[/tr]
[tr]
[td]CA Top[/td]
[td]683.49[/td]
[td]683.49[/td]
[td]747.75[/td]
[td]747.75[/td]
[/tr]
[tr]
[td][/td]
[td][/td]
[td][/td]
[td][/td]
[td][/td]
[/tr]
[tr]
[td]PA Top[/td]
[td]33.09[/td]
[td]75[/td]
[td]76.04[/td]
[td]75[/td]
[/tr]
[tr]
[td]PA Left[/td]
[td]7[/td]
[td]18[/td]
[td]20.07[/td]
[td]25[/td]
[/tr]
[tr]
[td]PA Height[/td]
[td]425.03[/td]
[td]410[/td]
[td]415.38[/td]
[td]410[/td]
[/tr]
[tr]
[td]PA Width[/td]
[td]661.49[/td]
[td]661.49[/td]
[td]723.68[/td]
[td]690[/td]
[/tr]
[tr]
[td][/td]
[td][/td]
[td][/td]
[td][/td]
[td][/td]
[/tr]
[tr]
[td]IPA Top[/td]
[td]33.09[/td]
[td]81.65[/td]
[td]82.68[/td]
[td]81.65[/td]
[/tr]
[tr]
[td]IPA Left[/td]
[td]47.79[/td]
[td]78.71[/td]
[td]80.77[/td]
[td]85.71[/td]
[/tr]
[tr]
[td]IPA Height[/td]
[td]425.03[/td]
[td]381.43[/td]
[td]386.82[/td]
[td]381.43[/td]
[/tr]
[tr]
[td]IPA Width[/td]
[td]608.16[/td]
[td]578.29[/td]
[td]640.48[/td]
[td]606.79[/td]
[/tr]
[/table]

Running the macro a third time does not change any values. I do nothing to the workbook between running the macro twice. Yet something happens the chart area after. I leave the macro.

I suspect part if the problem is that I can not set the Chart Area parameters.

Any Ideas?

Thanks


Mike Virostko.
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN

Forum statistics

Threads
1,224,823
Messages
6,181,177
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top