View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
keepITcool keepITcool is offline
external usenet poster
 
Posts: 2,253
Default Linking Chart directly to VBA function returning 2d array

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 :

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