Hello,
I have a function that returns an array, however I don't want/need all of the outputs all of the time. Is there a way for my inputs to determine which values are outputted?
Example:
But let's say I only need Sara's state and county, is there a way to limit the outputs to just those two?
i.e.
Function car(A1, 1, 1, 0, 0)
where
Function car(person as String, state as integer, county as integer, make as integer, model as integer)
but only the parameters inputted with a 1 are returned (A1 is the cell reference that hold the persons name)?
Thank you!
I have a function that returns an array, however I don't want/need all of the outputs all of the time. Is there a way for my inputs to determine which values are outputted?
Example:
Code:
Function car(person as String)
Dim info(3) as variant
state = 0: county = 1: make = 2: model = 3
Select Case person
Case Sara[INDENT]info(state) = "KS"
info(county) = "MI"
info(make) = "Chevy"
info(model) = "Tahoe"[/INDENT]
Case Steve[INDENT]info(state) = "KS"
info(county) = "DG"
info(make) = "Ford"
info(model) = "Excursion"[/INDENT]
End Select
car = info
End Function
But let's say I only need Sara's state and county, is there a way to limit the outputs to just those two?
i.e.
Function car(A1, 1, 1, 0, 0)
where
Function car(person as String, state as integer, county as integer, make as integer, model as integer)
but only the parameters inputted with a 1 are returned (A1 is the cell reference that hold the persons name)?
Thank you!
Last edited: