Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default setting source data

The simplest answer would be .......

ActiveChart.SetSourceData Source:=myNewSheet.myF _
, PlotBy:=xlColumns

but I suspect your range myF is not just the range for the chart data? If
it is then all well and good.

--
Cheers
Nigel



"cjsmith22" wrote
in message ...

cheers nigel - couple of problems though - i recorded a macro to set up
a chart and i got the following code:

Code:
--------------------
Charts.Add
ActiveChart.ChartType = xlColumnStacked
ActiveChart.SetSourceData Source:=Sheets("Update

8").Range("O19:O38,A19:A38") _
, PlotBy:=xlColumns
ActiveChart.Location Whe=xlLocationAsObject, Name:="Update 8"
With ActiveChart
.HasTitle = False
.Axes(xlCategory, xlPrimary).HasTitle = False
.Axes(xlValue, xlPrimary).HasTitle = False
End With
--------------------

As the name of the sheet will change every month (update 8 to update
9,10,11 etc) but it will always be the last sheet in the book, i set
'update 8' to the variable 'mynewSheet' ( Set mynewSheet =
myWorkbook.Worksheets(sCount) ) *also* , the range from where the data
is taken ("O19:O38,A19:A38") will also change every month so i set up
the variable 'myF'(a range in mynewSheet) (the data will always be in
columns O and A of 'myF') - how do i incorporate these two into
SetSourceData ?


--
cjsmith22
------------------------------------------------------------------------
cjsmith22's Profile:

http://www.excelforum.com/member.php...o&userid=28528
View this thread: http://www.excelforum.com/showthread...hreadid=484925



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
Setting hover data labels to cells other than source data Darren Charts and Charting in Excel 1 January 24th 06 10:20 AM
Setting hover data labels to cells other than source data Darren Excel Discussion (Misc queries) 0 January 24th 06 08:31 AM
Setting source data range with Charts D Charts and Charting in Excel 2 January 1st 06 02:51 AM
Setting Source Range For Chart James Stephens Excel Programming 4 March 4th 04 11:01 PM
Setting Spreadsheet control data source to Excel file Lyndsey Excel Programming 0 November 4th 03 05:35 PM


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