ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   controlling chart location (https://www.excelbanter.com/excel-programming/440567-controlling-chart-location.html)

festdaddy

controlling chart location
 
I have a process for making some charts, which I then place into
another sheet using 'activechart.location 2, sheetname'. Is there a
way to control where on the new sheet this ends up? If I send several
charts this way, they end up in the same location, so that I have to
drag them over to see them all. Here is the charting portion of my
code:

ActiveSheet.Shapes.AddChart(xlLine, 250, 15, 400,
200).Select
With ActiveChart
.SetSourceData Source:=primeTLAhistorng
.SeriesCollection(1).Name = Cells(2, 26)
.SeriesCollection(1).XValues = range(Cells(3, 25),
Cells(tlachtendrw, 25))
.SeriesCollection.NewSeries
.SeriesCollection(2).Values = TLAhistorng
.SeriesCollection(2).Name = TLAhistoname

.Legend.Position = xlBottom

.HasTitle = True
.ChartTitle.Text = "chart title goes here"
.ChartTitle.Font.Size = 12

.Axes(xlCategory).HasTitle = True
.Axes(xlCategory).AxisTitle.Text = "axis title
goes here"
.Axes(xlCategory).AxisTitle.Font.Size = 10
.Axes(xlCategory).TickLabels.Orientation = 90
.Axes(xlCategory).TickLabels.Font.Size = 8
.Axes(xlCategory).HasMajorGridlines = True

.Axes(xlValue).HasTitle = True
.Axes(xlValue).AxisTitle.Text = "value axis title
goes here"
.Axes(xlValue).AxisTitle.Font.Size = 10
.Axes(xlValue).TickLabels.NumberFormat = "0%"
.Location 2, "Chart_Display"
End With

festdaddy[_2_]

controlling chart location
 
Never mind, i figured it out. the location you give it with 'addchart'
is the location it will have in the new sheet.


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com