View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Doug Glancy Doug Glancy is offline
external usenet poster
 
Posts: 770
Default Graph macro question

Edwin,

The following line of code would set the source data for Chart 1 on the
active sheet to A2:B5

ActiveSheet.ChartObjects("Chart 1").Chart.SetSourceData
Source:=Sheets("Sheet1").Range("A2:B5")

Is that what you wanted?

If the chart is a separate sheet the code would be:

Charts("Chart1").SetSourceData Source:=Sheets("Sheet1").Range("A2:B5")

hth,

Doug


"Edwin Merced" wrote in message
...
I Have a multiple graphs inside a worksheet. But need to have a macro that
will allow me to sleect a range inside the worksheet for each graph. How

can
I assign with a macro the range for each graph?