How do I graph arrays using VBA?

G

Guest

I have some data which is stored in an array. At the moment my VB programme
prints the array into Excel (which is rather time consuming as the array has
8736 entries) then graph it directly from Excel. I have managed to create a
graph using my array but it seems that I can only plot 59 points! Is it
possible to plot more or will I have to print out my array and use Excel to
graph it?
Thanks very much for your help
 
P

Peter T

Your 59 points limit is probably due to the string length limit in the
series formula. But your values can be dumped to cells quickly like this -

Sub test()
Dim arr(1 To 10000, 1 To 1) As Double
Dim i as long
For i = 1 To 10000
arr(i, 1) = i / 10
Next
ActiveSheet.Range("A1:A" & UBound(arr)).Value = arr

End Sub

If you don't want to use cells at all you could make a named 'vertical'
array and assign that to your series values. Though xl97 & xl2000 would be
limited to 5461 values.

Regards,
Peter T
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top