#1   Report Post  
Alex
 
Posts: n/a
Default Chart Help Please

Hello Helper

I have an Excel workbook. It contains a chart and then several worksheets.
Each month I add a worksheet with data and I call it e.g. Apr 05 (I place
this on the tab). I then select some data from that worksheet and ass it to
the chart. The chart is updated so it shows all data e.g. Jan 05 Feb 05 Mar
05 Apr 05 and so on.

I wrote a Macro to help me automate the process but I have two main problems
relating to adding a new series to my existing chart:

1) How do I get the name of my new series to be the same as what is
displayed on the tab of my worksheet e.g. Feb 05?

2) How do I get the chart to reference a data series in my worksheet?

I recorded a Macro to see how this might work. For example, I copied the tab
name and pasted it directly into the 'name' field of the chart source data.
Also, I manually selected the data I wanted to display.

The problem is the notation that Excel records this in. For the data series,
it records it using R1C1 notation. I want to use something like...

Sheets("Feb 05"). Range((Cells(x, y), Cells(x, y))

Also, regarding point (1), I got this to work if I refernced a cell inthe
wroksheet that I has set as Feb 05. However, when it was displayed on the
chart it appeared as 1/02/05? How can I get it to display Feb 05 exactly. I
tried setting the cell format to 'Text' but that did not work.

Any help truly appreciated here. My code took 7 hours to write from getting
the data downloaded into Excel and sorting it to pick out the relevant parts.
The final hurdle is the chart part and I never anticipated falling down here!

Please help if you can.

Regards

Alex
  #2   Report Post  
P Sitaram
 
Posts: n/a
Default

Use the Add method of SeriesCollection to add the range:

ActiveChart.SeriesCollection.Add source:=Sheets("Feb 05").[A1:A10]

  #3   Report Post  
Alex
 
Posts: n/a
Default

P Sitaram

Thanks for replying.

Your post put me on the right tack and have now completed my project.

Thanks

Alex

"P Sitaram" wrote:

Use the Add method of SeriesCollection to add the range:

ActiveChart.SeriesCollection.Add source:=Sheets("Feb 05").[A1:A10]


Reply
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
Timeline Chart? ckrogers Charts and Charting in Excel 3 March 17th 05 09:20 PM
Editing a Chart Directly?? Charisma Riley Charts and Charting in Excel 3 January 26th 05 01:09 PM
Problem with xlusrgal.xls file Alfred S C Lee Charts and Charting in Excel 2 December 29th 04 05:54 PM
Impedding/Overlaying Charts Phil Hageman Charts and Charting in Excel 4 December 17th 04 07:25 PM
pivot table multi line chart souris Charts and Charting in Excel 2 December 7th 04 03:56 AM


All times are GMT +1. The time now is 02:15 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"