Linking Chart directly to VBA function returning 2d array

  • Thread starter Thread starter Damien Sawyer
  • Start date Start date
D

Damien Sawyer

Hello,

Can anyone tell me if it's possible to link a chart directly to a VBA
function that returns a 2d array?

I've had a play but had no luck.



Cheers



Damien Sawyer
 
Damien,


At first I could NOT get it to work...
(I'm NO expert on charts.. but i AM curious and 'creative')


the ADD method (or manually editing the series source would NOT accept
formulas or named formulas..


However I discovered it can be fooled :)


First I defined the name Sheet1!Test => =sheet1!$a$1

I pointed the dataseries to that NAME =Sheet1!test

THEN i changed the names definition to =GetData()
which is the name of my UDF..

Public Function GetData()
'dummy function
GetData = Array(120, 150, 180)
End Function

TADA!!!!!


howeever that's still a 1D array..
please experiment yourself using this approach..


--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Damien Sawyer wrote :
 

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

Back
Top