Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default Set Source two Worksheets

How do I use SetSourceData to get information from two different worksheets?

I have two matching tables on two worksheets and I would like to be able to
chart similar data from the two sheets. eg.

Chart5.SetSourceData Source:=Sheets("ResultsIn").Range("D3:D15,E3:E15") , And _
Sheets("ResultsOut").Range("D3:D15,E3:E15"), _
PlotBy:=xlColumns

David
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Set Source two Worksheets

set the source to one of the ranges, then add a new series from the other.

--
Regards,
Tom Ogilvy


"David" wrote:

How do I use SetSourceData to get information from two different worksheets?

I have two matching tables on two worksheets and I would like to be able to
chart similar data from the two sheets. eg.

Chart5.SetSourceData Source:=Sheets("ResultsIn").Range("D3:D15,E3:E15") , And _
Sheets("ResultsOut").Range("D3:D15,E3:E15"), _
PlotBy:=xlColumns

David

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default Set Source two Worksheets

Thanks Tom, that was quick!
Sorry I'm still a little new though.
What is the code to add a series?

David

"Tom Ogilvy" wrote:

set the source to one of the ranges, then add a new series from the other.

--
Regards,
Tom Ogilvy


"David" wrote:

How do I use SetSourceData to get information from two different worksheets?

I have two matching tables on two worksheets and I would like to be able to
chart similar data from the two sheets. eg.

Chart5.SetSourceData Source:=Sheets("ResultsIn").Range("D3:D15,E3:E15") , And _
Sheets("ResultsOut").Range("D3:D15,E3:E15"), _
PlotBy:=xlColumns

David

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Set Source two Worksheets

Slight modification of an example that was prevously posted by Jon Peltier:

With Worksheets("Review")
Set rngCht = .Range(.Cells(11, 7), .Cells(11, 24))
End With
With ActiveChart.SeriesCollection.NewSeries
.Name = Worksheets("Review").Cells(vX, 2)
.Values = rngCht
End With

You might want to check out some of his stuff if you do much Chart programming

John Peltier
http://peltiertech.com/

http://pubs.logicalexpressions.com/P...cle.asp?ID=209
Charting FAQs

List of articles by Peltie
http://pubs.logicalexpressions.com/P...Search&AUTH=25

--
Regards,
Tom Ogilvy



"David" wrote:

Thanks Tom, that was quick!
Sorry I'm still a little new though.
What is the code to add a series?

David

"Tom Ogilvy" wrote:

set the source to one of the ranges, then add a new series from the other.

--
Regards,
Tom Ogilvy


"David" wrote:

How do I use SetSourceData to get information from two different worksheets?

I have two matching tables on two worksheets and I would like to be able to
chart similar data from the two sheets. eg.

Chart5.SetSourceData Source:=Sheets("ResultsIn").Range("D3:D15,E3:E15") , And _
Sheets("ResultsOut").Range("D3:D15,E3:E15"), _
PlotBy:=xlColumns

David

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default Set Source two Worksheets

Thanks Tom they look good

The code worked too.

I put together the below code after looking through the list of objects and
checking out help on them. Are there any problems with using SeriesCollection
to do the same thing here?

ActiveChart.SeriesCollection.Add
Source:=Worksheets("ResultsOut").Range(ChartRange)

David

"Tom Ogilvy" wrote:

Slight modification of an example that was prevously posted by Jon Peltier:

With Worksheets("Review")
Set rngCht = .Range(.Cells(11, 7), .Cells(11, 24))
End With
With ActiveChart.SeriesCollection.NewSeries
.Name = Worksheets("Review").Cells(vX, 2)
.Values = rngCht
End With

You might want to check out some of his stuff if you do much Chart programming

John Peltier
http://peltiertech.com/

http://pubs.logicalexpressions.com/P...cle.asp?ID=209
Charting FAQs

List of articles by Peltier
http://pubs.logicalexpressions.com/P...Search&AUTH=25

--
Regards,
Tom Ogilvy



"David" wrote:

Thanks Tom, that was quick!
Sorry I'm still a little new though.
What is the code to add a series?

David

"Tom Ogilvy" wrote:

set the source to one of the ranges, then add a new series from the other.

--
Regards,
Tom Ogilvy


"David" wrote:

How do I use SetSourceData to get information from two different worksheets?

I have two matching tables on two worksheets and I would like to be able to
chart similar data from the two sheets. eg.

Chart5.SetSourceData Source:=Sheets("ResultsIn").Range("D3:D15,E3:E15") , And _
Sheets("ResultsOut").Range("D3:D15,E3:E15"), _
PlotBy:=xlColumns

David

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
Populating worksheets from source worksheet Roy Excel Worksheet Functions 1 January 14th 10 08:30 PM
I need to populate different worksheets from a source worksheet. Roy Excel Worksheet Functions 0 January 14th 10 07:38 PM
Combing source data from 2 worksheets. Monique Charts and Charting in Excel 2 February 15th 05 03:48 AM
How to source data from multiple worksheets in a PivotTable? Wally Excel Programming 2 December 9th 04 09:21 AM
Multiple Source Worksheets robeves Excel Programming 3 December 12th 03 01:01 PM


All times are GMT +1. The time now is 08:21 PM.

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"