Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Creating charts from a .dat file with vba.

Hi there,

I'm trying using excel vba to create multiple charts from data in a dat
file. The data comes in as a long list. I've created a loop to get the
data and plot it to different charts but my lack of experience with vba
is preventing me from getting it to work. This is my code

Sub DataChart()

Dim Irow As Long
Dim i As Integer
Dim srsNew As Series

Irow = 5
i = 5

Do Until i 5565
For j = 1 To 3
'' Create the chart
Charts.Add
ActiveChart.ChartType = xlXYScatter
ActiveChart.Location Whe=xlLocationAsNewSheet
'' Add the series
Set srsNew = ActiveChart.SeriesCollection.NewSeries
With srsNew
.Name = "Cells(Irow, 2)"
.Values = ActiveSheet.Range(Cells(i, j), Cells(i + 82,
j))
.XValues = ActiveSheet.Range(Cells(Irow, 1),
Cells(Irow + 82, 1))
End With
Next j
i = i + 83
Irow = Irow + 83
Loop
End Sub

I would appreciate any help or advice.

Thanks,

Simon.

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
Creating multiple charts from large data file smtt09 Charts and Charting in Excel 0 February 16th 09 02:19 PM
Creating charts Novice Excel Discussion (Misc queries) 2 September 29th 08 03:17 PM
Creating Charts coke Charts and Charting in Excel 1 March 31st 06 06:54 PM
creating charts with XY Willy Charts and Charting in Excel 2 September 12th 05 02:56 PM
Creating Charts using COM Jeff Charts and Charting in Excel 0 March 31st 05 06:31 PM


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