Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 66
Default Macro to create multiple charts?

Hi,
I have a bunch of excel files full of data, and each one contains
information which needs to be made into 30 charts (scatterplots). I have
been hand selecting the data and then creating each chart manually, but I am
hoping there is a way to automatize the process. Basically what I need to do
is this:

3 adjacent columns of data
look down column 1 for the word "stop" (the rest are all numbers)
when you get to stop, select all three columns until the next time there's a
"stop" in column 1
make the scatterplot
do it again from the next stop (the stop lines can just be skipped when
selecting data for the chart)

Does anyone have any pointers for me?

Thanks so much!
Christina
  #2   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 6,582
Default Macro to create multiple charts?

Forgot the code!

Sub ChartBetweenStops()
Dim rStop1 As Range
Dim rStop2 As Range
Dim rStopFirst As Range
Dim rChartData As Range
Dim cht As Chart

ActiveSheet.Range("A1").Select
Set rStopFirst = ActiveSheet.Cells.Find(What:="stop", After:=ActiveCell)
Set rStop2 = rStopFirst
Do
Set rStop1 = rStop2
Set rStop2 = Cells.FindNext(After:=rStop1)
If rStop2.Address = rStopFirst.Address Then Exit Do
Set rChartData = rStop1.Offset(1).Resize(rStop2.Row - rStop1.Row - 1, 3)
Set cht = ActiveSheet.ChartObjects.Add(rStop1.Offset(, 3).Left,
rStop1.Offset(1).Top, 250, 200).Chart
With cht
.ChartType = xlXYScatter
.SetSourceData Source:=rChartData
' include other chart formatting here
End With
Loop
End Sub


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


"Christina" wrote in message
...
Hi,
I have a bunch of excel files full of data, and each one contains
information which needs to be made into 30 charts (scatterplots). I have
been hand selecting the data and then creating each chart manually, but I
am
hoping there is a way to automatize the process. Basically what I need to
do
is this:

3 adjacent columns of data
look down column 1 for the word "stop" (the rest are all numbers)
when you get to stop, select all three columns until the next time there's
a
"stop" in column 1
make the scatterplot
do it again from the next stop (the stop lines can just be skipped when
selecting data for the chart)

Does anyone have any pointers for me?

Thanks so much!
Christina



  #3   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 6,582
Default Macro to create multiple charts?

Here's something quick and dirty. It uses the first column as X values and
the second and third as Y values for two series. Activate a worksheet with
the data separated by cells that say "stop", and it will knock out the
charts.

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


"Christina" wrote in message
...
Hi,
I have a bunch of excel files full of data, and each one contains
information which needs to be made into 30 charts (scatterplots). I have
been hand selecting the data and then creating each chart manually, but I
am
hoping there is a way to automatize the process. Basically what I need to
do
is this:

3 adjacent columns of data
look down column 1 for the word "stop" (the rest are all numbers)
when you get to stop, select all three columns until the next time there's
a
"stop" in column 1
make the scatterplot
do it again from the next stop (the stop lines can just be skipped when
selecting data for the chart)

Does anyone have any pointers for me?

Thanks so much!
Christina



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
Macro to create charts JDB Charts and Charting in Excel 1 July 25th 07 02:38 PM
Is there a macro to create charts automatically? JDB Charts and Charting in Excel 5 July 23rd 07 09:52 AM
Macro to create charts? Ed Charts and Charting in Excel 2 September 25th 06 08:49 PM
Vb macro stops when I try to create more than 89 charts Tiberius Charts and Charting in Excel 0 January 19th 06 05:52 PM
Create Multiple Charts w/ VB quickcreator Charts and Charting in Excel 1 October 4th 05 03:19 AM


All times are GMT +1. The time now is 04:33 AM.

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"