ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   naming multiple public variables generated by single function (https://www.excelbanter.com/excel-programming/272356-naming-multiple-public-variables-generated-single-function.html)

Mark Kubicki

naming multiple public variables generated by single function
 
i have a function that i use on several worksheets to create a variable of
different names that is public

since the public variable needs to be dimensioned in the declarations
section of the module, i need to know the name of the variable, but will not
until the function runs, unless i dim every possible name that might be used
(?)

ex:
the function counts the number of rows of data on sheets 1, 2, 3...

the function would return public variables: lSheet1RowsData,
lSheet2RowsData, lSheet3RowsData,

for this to run, i would need to dim every possible lSheet...RowsData in
declarations, which seems to defeat the whole point a creating this
function.

i'm sure that there's a trick ?

thanks in advance,
mark



Lance[_2_]

naming multiple public variables generated by single function
 
Perhaps an array, indexs indentifying the sheet.


-----Original Message-----
i have a function that i use on several worksheets to

create a variable of
different names that is public

since the public variable needs to be dimensioned in the

declarations
section of the module, i need to know the name of the

variable, but will not
until the function runs, unless i dim every possible name

that might be used
(?)

ex:
the function counts the number of rows of data on sheets

1, 2, 3...

the function would return public variables:

lSheet1RowsData,
lSheet2RowsData, lSheet3RowsData,

for this to run, i would need to dim every possible

lSheet...RowsData in
declarations, which seems to defeat the whole point a

creating this
function.

i'm sure that there's a trick ?

thanks in advance,
mark


.



All times are GMT +1. The time now is 07:16 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com