View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.misc,microsoft.public.office.developer.vba,microsoft.public.excel.charting,microsoft.public.excel.worksheet.functions
Jon Peltier Jon Peltier is offline
external usenet poster
 
Posts: 6,582
Default plot graph from multiple worksheet as embedded chart object on every worksheet

Jeff -

It goes something like this:

Sub ChartOnEveryWorksheet()
Dim ws As Worksheet
Dim cht As Chart

For Each ws In ActiveWorkbook.Worksheets
Set cht = ws.ChartObjects.Add(100,100,350,275).Chart
' adjust arguments above to get preferred chart position in sheet
cht.ChartType = xlXYScatter
' adapt to your preferred chart type
With cht.NewSeries
.Name = "Whatever"
.XValues = ws.Range("B1:B100")
.Values = ws.Range("D1:D100")
' Adjust ranges as required
End With
Next
End Sub

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


wrote in message
oups.com...
Hi i want to plot the graph for every worksheet (column B and column
D). I have more than 50 worksheets in the same workbook. How do i write
a macro to ask the excel to plot the graph for every sheet and present
the chart object on the same sheet? thank you very much for your help!
i have been working on this over 2 days still cannot figure it out...