View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
RB Smissaert RB Smissaert is offline
external usenet poster
 
Posts: 2,452
Default Passing large number of variables to function

Yes, I can now see the pros and cons of both methods.
The array method will involve more code, but it looks a bit cleaner (less
dots as well) and I will try that first.

RBS

"Niek Otten" wrote in message
...
You can declare the Type Publicly, but Dim the variables of that type
Locally

--
Kind regards,

Niek Otten

Microsoft MVP - Excel

"RB Smissaert" wrote in message
...
Trying to find the best solution to the following:
I have a number of Subs in different modules that are using the same
function.
These Subs have to pass a large number of variables of different types
(boolean, byte, long, string) to this function.
I can't use these variables directly as arguments in the function as
there will be an error, number of arguments too large.
I could solve this by making a UDT, but the problem is that this UDT then
has to be declared publicly to be accessible
from the different modules. This seems to be against the general
principle that the number of public variables should be as small as
possible.
Another option would be to use a number of arrays, one for each datatype,
but this involves a lot more coding.
Any suggestions what the best approach is for this?

RBS