Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Only a variant can be assigned an array - however, there usually is no need
to assign it if you pass it through the arguments of the function - but since you are giving it a new name, I assume you are assigning it. I would advise against calling your array "Array" since this is a keyword. -- Regards, Tom Ogilvy "goltinfron" wrote in message ... Ok, this may sound stupid, but, I have a program where I call in a nxm array, I will call it array0. That array is then sent to another function, and comes back, I'll call it array1. I then use try to use array1 in another function, but I get an error message. Do I need to redefine array1 as a variant before I use in another function? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Tom thanks, but that is not exactly what I was getting at. Maybe this will make thing clearer
function coordinates(coord ReDim a(row,column) As Varian Dim b() As Doubl a=coordinates2(coord) 'where coordinates2 is second functio b=coordinates3(a) 'where coordinates 3 is a third functio after this, i go on and do other stuff My problem is that I can get the proper answer for a, but when I try to use a in equation b, it comes up with an erro Sean |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Pretty sketchy data (like you didn't state what the error message is),
but I assume that it is "Can't assign to array". If so, this is not a problem with a but is because b is declared as Double(). You can't assign directly to a non-Variant() array. Alan Beban goltinfron wrote: Tom thanks, but that is not exactly what I was getting at. Maybe this will make thing clearer. function coordinates(coord) ReDim a(row,column) As Variant Dim b() As Double a=coordinates2(coord) 'where coordinates2 is second function b=coordinates3(a) 'where coordinates 3 is a third function after this, i go on and do other stuff. My problem is that I can get the proper answer for a, but when I try to use a in equation b, it comes up with an error Sean |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
seems exactly what you were getting at:
Only a variant can be assigned an array -- Regards, Tom Ogilvy "goltinfron" wrote in message ... Tom thanks, but that is not exactly what I was getting at. Maybe this will make thing clearer. function coordinates(coord) ReDim a(row,column) As Variant Dim b() As Double a=coordinates2(coord) 'where coordinates2 is second function b=coordinates3(a) 'where coordinates 3 is a third function after this, i go on and do other stuff. My problem is that I can get the proper answer for a, but when I try to use a in equation b, it comes up with an error Sean |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Functions/arrays | Excel Discussion (Misc queries) | |||
passing arrays to user defined functions | Excel Worksheet Functions | |||
Passing parameters between functions | Excel Programming | |||
Passing Parameters to Userdefined Functions | Excel Programming | |||
Passing arrays to a subroutine | Excel Programming |