Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Make a graph with for cycle


Good Morning,

i get this problem: i have a worksheet like this:



A B C D
1 10/03 2 10/03 45
2 11/03 6 11/03 85
3 12/03 8 12/03 96
4 13/03 3 13/03 52


what i would like to do is a macro that make a graph taking columns A&B
and then a second grafh taking columns C&D and so on...

i wrote this, but it does not work (in my spreadsheet i get 146 columns
and 256 rows...):

For i = 1 To 146
Range(.Cells(i, 2), .Cells(i + 1, 256)).Select
Range(Selection, Selection.End(xlDown)).Select
Charts.Add
ActiveChart.ChartType = xlAreaStacked
ActiveChart.SetSourceData
Source:=Sheets("INDUSTRIALS").Range(.Cells(i, 2), .Cells(i + 1, 256)),
_
PlotBy:=xlColumns
ActiveChart.Location Whe=xlLocationAsObject,
Name:="INDUSTRIALS"
With ActiveChart
HasTitle = True
ChartTitle.Characters.Text = "Asset Swap Spread Bid"
Axes(xlCategory, xlPrimary).HasTitle = False
Axes(xlValue, xlPrimary).HasTitle = False
End With
ActiveChart.Legend.Select
Selection.Delete
Next i
End Sub


any help? thank you!


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,071
Default Make a graph with for cycle

In article ,
says...
<snip}

i wrote this, but it does not work (in my spreadsheet i get 146 columns
and 256 rows...):

<snip

How does it not work?

Also, what is your intent? One chart with 73 series in it? Or 73
charts with 1 series in each? Of course, neither seems aesthetically
appealing.

You might also want to check the Excel | Tutorials | 'Dynamic Charts'
page of my web site. One of the examples addresses how to select one
column from a list of many as the source for a chart.

--
Regards,

Tushar Mehta, MS MVP -- Excel
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article ,
says...

Good Morning,

i get this problem: i have a worksheet like this:



A B C D
1 10/03 2 10/03 45
2 11/03 6 11/03 85
3 12/03 8 12/03 96
4 13/03 3 13/03 52


what i would like to do is a macro that make a graph taking columns A&B
and then a second grafh taking columns C&D and so on...

i wrote this, but it does not work (in my spreadsheet i get 146 columns
and 256 rows...):

For i = 1 To 146
Range(.Cells(i, 2), .Cells(i + 1, 256)).Select
Range(Selection, Selection.End(xlDown)).Select
Charts.Add
ActiveChart.ChartType = xlAreaStacked
ActiveChart.SetSourceData
Source:=Sheets("INDUSTRIALS").Range(.Cells(i, 2), .Cells(i + 1, 256)),
_
PlotBy:=xlColumns
ActiveChart.Location Whe=xlLocationAsObject,
Name:="INDUSTRIALS"
With ActiveChart
HasTitle = True
ChartTitle.Characters.Text = "Asset Swap Spread Bid"
Axes(xlCategory, xlPrimary).HasTitle = False
Axes(xlValue, xlPrimary).HasTitle = False
End With
ActiveChart.Legend.Select
Selection.Delete
Next i
End Sub


any help? thank you!


------------------------------------------------
~~ Message posted from
http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/


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
how to make a bar graph lolprinze New Users to Excel 1 May 18th 10 08:14 PM
How do I make a graph with 2-cycle X 3-cycle log-log graph paper? Charles A. Wilson Charts and Charting in Excel 1 December 17th 09 03:03 AM
Excel log graph with PARTIAL CYCLE [email protected] Charts and Charting in Excel 3 February 12th 09 07:19 PM
Can I make a graph to be a specific size? (actual graph) Jessica Excel Discussion (Misc queries) 0 August 14th 06 08:45 PM
How do I keep result from 1 iteration cycle to use in next cycle? sgl8akm Excel Discussion (Misc queries) 0 July 27th 06 08:28 PM


All times are GMT +1. The time now is 01:49 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"