This is one of those how-do-you-do-it type questions, where I hope the answer is (relatively) simple.
I'm working on a user-defined function that takes averages between cells. The cells need to be from multiple worksheets. So to call the function within the workbook, I'd use
...and the function:
I would think this should work, but it returns a #VALUE error.
Note that if I use
I do not get an error message.
What am I missing here? I see plenty of examples of UDF's where the range is contiguous cells, but nothing online that handles exactly what I'm trying to do.
I'm working on a user-defined function that takes averages between cells. The cells need to be from multiple worksheets. So to call the function within the workbook, I'd use
Code:
=myAverage(Sheet1!A1, Sheet2!A1, Sheet3!A1)
...and the function:
Code:
Public Function myAverage(cellSet As Range)
'etc
End Function
I would think this should work, but it returns a #VALUE error.
Note that if I use
Code:
myAverage(A1:A5)
I do not get an error message.
What am I missing here? I see plenty of examples of UDF's where the range is contiguous cells, but nothing online that handles exactly what I'm trying to do.