Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Need Help creating multiple graphs through coding

Greetings-

I have a spreadsheet that has roughly 4500 rows with 7 columns of data
Along each row I need to make a line graph that uses the values fro
the seven columns in that row.

Seeing as though creating each chart one by one would take FOREVER
was wondering if there is a way to write a program that will do thi
for me?

I purchased a book called "Writing Excel Macros" by Steven Roman. Bu
I am still having trouble finding anything that will help. If someon
could help me, or direct me where to go it would be very muc
appreciated.

Thank you

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default Need Help creating multiple graphs through coding

What is the purpose of creating all those graphs? Do you really need
to create them all at the same time or could you just create a block
at a time?

In the past when creating large numbers of plots from the same
datablock I've found it works well to create a graph, copy a picture
of it and paste it into another sheet, shift the graph data source to
the next row, copy picture etc etc.

If you need to get a start you might try recording a macro while
creating the first graph and use that as a basis. Be warned that 4500
plots is a large number for one spreadsheet so you may not be able to
create them all in one batch.

You can contact me via email if you are really stuck and I'll try
digging out some previous code...


Tim.



"canes_26 " wrote in message
...
Greetings-

I have a spreadsheet that has roughly 4500 rows with 7 columns of

data.
Along each row I need to make a line graph that uses the values from
the seven columns in that row.

Seeing as though creating each chart one by one would take FOREVER I
was wondering if there is a way to write a program that will do this
for me?

I purchased a book called "Writing Excel Macros" by Steven Roman.

But
I am still having trouble finding anything that will help. If

someone
could help me, or direct me where to go it would be very much
appreciated.

Thank you.


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Need Help creating multiple graphs through coding

Hi,

Assuming there is a unique value in you first column:

Option Explicit

Sub MakeGraphs()
Dim lRow As Long
Dim sSheet As String
Dim sGraph As String
Dim sSource As String
'
Application.ScreenUpdating = False
sSheet = ActiveSheet.Name
For lRow = 2 To ActiveSheet.UsedRange.Rows.Count
sSource = "A1:G1,A" & CStr(lRow) & ":G" & CStr(lRow)
Range(sSource).Select
Range("A" & CStr(lRow)).Activate
sGraph = ActiveCell.Value
Charts.Add
ActiveChart.ChartType = xlLineMarkers
ActiveChart.SetSourceData _
Source:=Sheets(sSheet).Range(sSource), _
PlotBy:=xlRows
ActiveChart.Location Whe=xlLocationAsNewSheet

With ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = sGraph
.Axes(xlCategory, xlPrimary).HasTitle = False
.Axes(xlValue, xlPrimary).HasTitle = False
End With
ActiveSheet.Name = sGraph
Sheets(sSheet).Activate
Next
Application.ScreenUpdating = True
End Sub

Good luck,


Wouter HM.

canes_26 wrote in message ...
Greetings-

I have a spreadsheet that has roughly 4500 rows with 7 columns of data.
Along each row I need to make a line graph that uses the values from
the seven columns in that row.

Seeing as though creating each chart one by one would take FOREVER I
was wondering if there is a way to write a program that will do this
for me?

I purchased a book called "Writing Excel Macros" by Steven Roman. But
I am still having trouble finding anything that will help. If someone
could help me, or direct me where to go it would be very much
appreciated.

Thank you.


---
Message posted 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
Color coding data in line graphs brewer Charts and Charting in Excel 1 July 28th 09 06:17 PM
Creating graphs from data in other files Gaijintendo Excel Discussion (Misc queries) 1 July 23rd 08 03:39 PM
Creating Multiple Graphs at a Time Matt Carney Charts and Charting in Excel 2 May 27th 08 05:08 AM
Creating Circles on Excel Graphs [email protected] Excel Worksheet Functions 2 February 23rd 07 05:29 PM
Creating two bar graphs Lisa Charts and Charting in Excel 3 December 6th 05 01:41 PM


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