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: 51
Default Adding a data series to a chart

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
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
Chart data scrunches to left when adding X axis date series Kellian Charts and Charting in Excel 0 February 8th 10 04:36 PM
adding a line to show average for a data series on a chart Judy Rose Charts and Charting in Excel 1 August 22nd 08 10:01 PM
Adding a second series to an existing chart Angela Charts and Charting in Excel 4 February 8th 07 05:46 PM
Adding data series to chart via macro JessK Charts and Charting in Excel 1 March 1st 06 11:04 PM
Problem adding Series XValues to Chart using VBA Sean Curry Charts and Charting in Excel 0 March 14th 05 12:18 AM


All times are GMT +1. The time now is 06:27 AM.

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"