LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 300
Default Changing plot area under macro

When my chart is inactive I clear the data, and I also have to clear the
title. Setting the title to a empty string didn't work, so I am using this
code (though I would prefer to not have to select or activate it):

Sheets("Graphs").Select
ActiveSheet.ChartObjects(1).Activate
ActiveChart.ChartArea.Select
ActiveChart.HasTitle = False

But then when I recreate the chart I find that Excel has gone back to the
absurdly large font size of 22. So I change it to 14. But then I find that
Excel has pushed my plot area down to accomodate the large font. But I
haven't been able to increase the plot area under macro control. This is
the code I'm using to create the chart:

With Worksheets("Graphs").ChartObjects(1).Chart
.SeriesCollection(1).XValues = "=Graphs!R12C17:R" & NewLastRow & "C17"
.SeriesCollection(1).Values = "=Graphs!R12C18:R" & NewLastRow & "C18"
.HasTitle = True
.ChartTitle.Font.Size = 14
.ChartTitle.Text = Range("GraphTitle").Value
If Range("CDFflag").Value Then
.Axes(xlValue).MaximumScale = 1
Else
.Axes(xlValue).MaximumScaleIsAuto = True
End If
.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = Res(1)
If Res(2) = 1 Then
.Axes(xlCategory).TickLabels.NumberFormat = "0.0"
Else
.Axes(xlCategory).TickLabels.NumberFormat = "0"
End If
End With

Then how do I add this functionality to the above?

ActiveChart.ChartArea.Select
ActiveChart.PlotArea.Select
Selection.Top = 28
Selection.Height = 206

Thanks, Don <donwiss at panix.com.
 
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
Repeating gradient for each vertical area of plot area Steve Vincent Charts and Charting in Excel 3 October 27th 09 11:25 PM
How do you show plot area only-no chart area SteveOz Charts and Charting in Excel 1 September 19th 07 10:06 AM
Resize plot area in a chart area Darlene Excel Discussion (Misc queries) 0 July 10th 06 02:50 PM
How to increase chart area without affecting plot area? [email protected] Charts and Charting in Excel 2 April 21st 06 09:05 PM
Resize chart area without resizing plot area Janwillem van Dijk Charts and Charting in Excel 2 August 2nd 05 01:52 AM


All times are GMT +1. The time now is 06:20 PM.

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"