LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Ali Baba
 
Posts: n/a
Default Making charts from arrays in VBA

I have been trying to take two arrays of numbers in VBA and make a
scatterplot, but have been unsuccessful. It's easy enough to use the
cells in a worksheet as the source for a chart, but I would like to go
directly from data to chart without an intermediate step of printing the
array out to cells in a worksheet.

This is the VBA procedure which shows that it generates points in columns A
and B

Sub Plot()
Dim mu As Single
Dim segma As Single
Dim xFirst As Single
Dim xLast As Single
Dim X As Single
Dim Y As Single
Dim lngRow As Long
Dim StepValue As Single
Dim Steps As String

xFirst = Sheets(1).Range("B1")
xLast = Sheets(1).Range("B2")
Steps = Sheets(1).Range("B3")
mu = Sheets(1).Range("B4")
segma = Sheets(1).Range("B5")

StepValue = (xLast - xFirst) / (Steps - 1)
lngRow = 0
X = xFirst

With Sheets(1).Range("A10")
Do While X <= xLast
.Offset(lngRow, 0) = X
Y = Application.WorksheetFunction.Â*NormDist(X, mu,
segma,False)
.Offset(lngRow, 1) = Y
X = X + StepValue
lngRow = lngRow + 1
Loop
End With

End Sub

Can anybody tell me how to do it??

Thanks for any help

 
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
Charts won't update pwermuth Charts and Charting in Excel 8 July 15th 05 07:32 PM
Excel Charts Linked to Spreadsheets Rich Charts and Charting in Excel 1 July 4th 05 04:36 PM
making charts based on text categories cwling Excel Discussion (Misc queries) 1 May 27th 05 03:48 AM
linkingof charts in worksheets to cells steve Excel Discussion (Misc queries) 0 May 6th 05 01:44 AM
Can't create dynamic charts Brian Sells Charts and Charting in Excel 7 March 22nd 05 04:23 AM


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