Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
I have a routine that adds data series to a chart. The chart resides in Worksheet "Server 1" and is ChartObjects("Chart 3"). The routine selects the chart and adds the data series. Ideally I would like to be able to trigger this routine by clicking on a button in another worksheet and add the data series without having to navigate to the worksheet and select the chart. Can this be done? I have enclosed my code below. Sub AddSeries() ActiveSheet.ChartObjects("Chart 3").Activate ActiveChart.ChartArea.Select ActiveChart.SeriesCollection.NewSeries ActiveChart.SeriesCollection.NewSeries ActiveChart.SeriesCollection(1).XValues = Sheets("Server 2 Database Space Summary").Range("B6:B19") ActiveChart.SeriesCollection(1).Values = Sheets("Server 2 Database Space Summary").Range("E6:E19") ActiveChart.SeriesCollection(1).Name = "=""MB Used""" ActiveChart.SeriesCollection(2).XValues = Sheets("Server 2 Database Space Summary").Range("B6:B19") ActiveChart.SeriesCollection(2).Values = Sheets("Server 2 Database Space Summary").Range("F6:F19") ActiveChart.SeriesCollection(2).Name = "=""MB Free""" End Sub Hope someone can help. Many thanks in advance - Grant |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Chart data scrunches to left when adding X axis date series | Charts and Charting in Excel | |||
adding a line to show average for a data series on a chart | Charts and Charting in Excel | |||
Adding a second series to an existing chart | Charts and Charting in Excel | |||
Adding data series to chart via macro | Charts and Charting in Excel | |||
Problem adding Series XValues to Chart using VBA | Charts and Charting in Excel |