PC Review


Reply
Thread Tools Rate Thread

Creating Multiple Graphs in Excel 2003

 
 
Don
Guest
Posts: n/a
 
      30th Jan 2007
I am trying to create a graph for each row of a worksheet, by creating
a macro. Using variables, and a FOR, NEXT statement, I can select the
title row and the data row for each row, and rename each chart
produced. But I cannot replace the original selection range with the
variable range "myMultipleRange", in the chart part of the macro. Does
anyone have any idea how to do this?

 
Reply With Quote
 
 
 
 
=?Utf-8?B?VG9tIE9naWx2eQ==?=
Guest
Posts: n/a
 
      30th Jan 2007
Your posting is vary vague, but I would suggest taking an existing chart,
turn on the macro recorder, then manually change the source data in a similar
fashion to what your are attempting to do programmatically. Then look at the
code and see how you might adapt it to suite your needs.

--
Regards,
Tom Ogilvy


"Don" wrote:

> I am trying to create a graph for each row of a worksheet, by creating
> a macro. Using variables, and a FOR, NEXT statement, I can select the
> title row and the data row for each row, and rename each chart
> produced. But I cannot replace the original selection range with the
> variable range "myMultipleRange", in the chart part of the macro. Does
> anyone have any idea how to do this?
>
>

 
Reply With Quote
 
Jon Peltier
Guest
Posts: n/a
 
      30th Jan 2007
Post the piece of code you were troubled with.

Not knowing what that looks like, here's code I posted a while back for
creating one pie chart per row of data:

Sub OnePieChartPerRow()

Dim rngChartData As Range

Dim iRowIx As Integer, iRowCt As Integer, iColCt As Integer

Dim oChart As ChartObject

Dim NewSrs As Series


If Not TypeName(Selection) = "Range" Then Exit Sub


Set rngChartData = Selection

iRowCt = rngChartData.Rows.Count

iColCt = rngChartData.Columns.Count


For iRowIx = 2 To iRowCt

Set oChart = ActiveSheet.ChartObjects.Add(Top:=25 + (iRowIx - 2) * 200, _

Height:=200, Left:=450, Width:=300)

Set NewSrs = oChart.Chart.SeriesCollection.NewSeries

oChart.Chart.ChartType = xlPie

With oChart.Chart.PlotArea

..Border.LineStyle = xlNone

..Interior.ColorIndex = xlNone

End With

With NewSrs

'' Name in first column

..Name = rngChartData.Cells(iRowIx, 1)

..Values = rngChartData.Cells(iRowIx, 2).Resize(1, iColCt - 1)

'' XValues in first row

..XValues = rngChartData.Cells(1, 2).Resize(1, iColCt - 1)

End With

Next


End Sub


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


"Don" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I am trying to create a graph for each row of a worksheet, by creating
> a macro. Using variables, and a FOR, NEXT statement, I can select the
> title row and the data row for each row, and rename each chart
> produced. But I cannot replace the original selection range with the
> variable range "myMultipleRange", in the chart part of the macro. Does
> anyone have any idea how to do this?
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating Multiple Graphs at a Time Matt Carney Microsoft Excel Charting 2 27th May 2008 05:08 AM
Creating Circles on Excel Graphs theelitegoldfish@gmail.com Microsoft Excel Worksheet Functions 2 23rd Feb 2007 05:29 PM
Question About Creating Graphs in Excel 2003 =?Utf-8?B?cmF6b3I=?= Microsoft Excel Charting 2 31st Jan 2007 06:20 PM
Need Help creating multiple graphs through coding canes_26 Microsoft Excel Programming 2 28th Apr 2004 09:00 AM
creating multiple graphs in MS Access 2000. Anita Curtis Microsoft Access Reports 1 8th Oct 2003 03:07 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:21 AM.