Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Charting / July 2006

Tip: Looking for answers? Try searching our database.

Use a loop to create multiple Charts - Suggestions ?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
APOEL - 28 Jul 2006 21:53 GMT
I am running a loop in VBA which is supposed to draw a new chart fo
every (2) column(s) of data.

However, I am not sure how to make it "jump" from column to column.
Part of my program (does not include the "For i=1 to3 e.t.c.) is below
The *high-lighted *part is the part I am trying to change. Instead of
fixed reference I wanted to get the data I have in th
_underlined__part. Any suggestions???

Sheets("OUTPUT All data").Select

_Range(Cells(11,_2_*_i),_Cells(11,_2_*_i_+_1)).Select_  
Range(Selection, Selection.End(xlDown)).Select
Charts.Add
ActiveChart.ChartType = xlLineMarkers
ActiveChart.SetSourceData Source:=Sheets("OUTPUT Al
data").Range(Cells(11, 2 * i), Cells(11, 2 * i + 1)).Select
Range(Selection, Selection.End(xlDown)).Select_
PlotBy:=xlColumns
'ActiveChart.SetSourceData Source:=Sheets("OUTPUT Al
data").*Range("B11:C316") _*        , PlotBy:=xlColumns
ActiveChart.Location Where:=xlLocationAsNewSheet
ActiveChart.HasLegend = True
ActiveChart.Legend.Select
Selection.Position = xlTop
ActiveChart.ChartArea.Select
Selection.AutoScaleFont = Tru
Jon Peltier - 29 Jul 2006 03:36 GMT
Try this:

ActiveChart.SetSourceData Source:=Sheets("OUTPUT All data") _
 .Range(Cells(11, 2 * i), Cells(11, 2 * i + 1).End(xlDown)), _
 PlotBy:=xlColumns

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

> I am running a loop in VBA which is supposed to draw a new chart for
> every (2) column(s) of data.
[quoted text clipped - 23 lines]
> ActiveChart.ChartArea.Select
> Selection.AutoScaleFont = True
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.