Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
cteq
 
Posts: n/a
Default Want to plot a graph using data from 2 different worksheets in sam

workbook.

I want to take 2003, 2004 sales and 2005 sales on same graph. Data is in the
same file with different worksheet, I cant seem to plot it.

I had to copy all the data on same worksheet and then plot it. But there
must be a way to do it without this action.

  #2   Report Post  
Steve
 
Posts: n/a
Default

Try charting one year then: Chart; Source Data; Add to add the rest.


"cteq" wrote in message
...
workbook.

I want to take 2003, 2004 sales and 2005 sales on same graph. Data is in
the
same file with different worksheet, I cant seem to plot it.

I had to copy all the data on same worksheet and then plot it. But there
must be a way to do it without this action.



  #3   Report Post  
cteq
 
Posts: n/a
Default

I can do one year no problem at all.

"Steve" wrote:

Try charting one year then: Chart; Source Data; Add to add the rest.


"cteq" wrote in message
...
workbook.

I want to take 2003, 2004 sales and 2005 sales on same graph. Data is in
the
same file with different worksheet, I cant seem to plot it.

I had to copy all the data on same worksheet and then plot it. But there
must be a way to do it without this action.




  #4   Report Post  
Steve
 
Posts: n/a
Default

Try some code:

'before you start, create a blank chart sheet in your workbook


Option Base 1
Sub addSeriesFromAllSheets()

Charts("chart1").Activate ' rename chart1 to match the name of your new,
blank chart
'ensure the chart is blank
RemoveData

For Each ws In Worksheets
If IsNumeric(Right(ws.Name, 4)) Then 'use a sheet naming convention
'so you miss those you don't wish to chart.
'in this case, if the last four characters are numbers, it data will plot on
the chart
ActiveChart.SeriesCollection.Add _
Source:=ws.Range("A1:B6") ' Edit this so it covers the range in
the sheets you wish to chart
End If
Next ws
End Sub
Sub RemoveData()
On Error GoTo Exit_RemoveData
While ActiveChart.SeriesCollection.Count 0

ActiveChart.SeriesCollection(1).Select
Selection.Delete
Wend
Exit_RemoveData:
End Sub

"cteq" wrote in message
...
I can do one year no problem at all.

"Steve" wrote:

Try charting one year then: Chart; Source Data; Add to add the rest.


"cteq" wrote in message
...
workbook.

I want to take 2003, 2004 sales and 2005 sales on same graph. Data is
in
the
same file with different worksheet, I cant seem to plot it.

I had to copy all the data on same worksheet and then plot it. But
there
must be a way to do it without this action.






  #5   Report Post  
Oliver Ferns via OfficeKB.com
 
Posts: n/a
Default

Name your ranges (Sales2002, Sales2003, etc), then add them to the chart
preceeded by the file name...

eg

Series 1 Values = Sales.xls!2002Sales
Series 2 Values = Sales.xls!2003Sales
etc...

will do the trick...

Hth,
Oli

--
Message posted via http://www.officekb.com


  #6   Report Post  
Jon Peltier
 
Posts: n/a
Default

This page might help:

http://peltiertech.com/Excel/ChartsH...iffSheets.html

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

cteq wrote:

workbook.

I want to take 2003, 2004 sales and 2005 sales on same graph. Data is in the
same file with different worksheet, I cant seem to plot it.

I had to copy all the data on same worksheet and then plot it. But there
must be a way to do it without this action.

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
Scatter Graph - Data Label Problems TBD Charts and Charting in Excel 2 January 16th 05 06:08 PM
Pulling data from 1 sheet to another Dave1155 Excel Worksheet Functions 1 January 12th 05 06:55 PM
How can I plot a data series from multiple worksheets bret Charts and Charting in Excel 2 January 3rd 05 02:23 AM
How can I plot a data series from multiple worksheets bret Charts and Charting in Excel 0 January 2nd 05 07:53 PM
Named dynamic ranges, copied worksheets and graph source data WP Charts and Charting in Excel 1 November 28th 04 06:19 PM


All times are GMT +1. The time now is 02:41 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"