View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Leith Ross[_530_] Leith Ross[_530_] is offline
external usenet poster
 
Posts: 1
Default How to add data Range property at runtime to excel sheet


Hello Areddy,

_____________________________

Sub ChangeChartDataRange()

Dim Chrt As Chart
Set Chrt = ActiveSheet.ChartObjects("Chart 1").Chart
Chrt.SetSourceData Source:=Worksheets("TestTemplate1").Range(Cells(37
7), Cells(38, 18))

End Sub
_____________________________

Be sure to change "Chart 1" to the system name for your chart. To fin
the system chart name, right click on the chart. Select "Chart Window
from the Popup Menu. The Title will contain the Workbook name an
Worksheet name followed by the chart name. Just use the chart name.

Chart Name Example:
[My Workbook.xls]TestTemplate1 Chart 1

Sincerely,
Leith Ros

--
Leith Ros
-----------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...fo&userid=1846
View this thread: http://www.excelforum.com/showthread.php?threadid=50883