I don't find how to use cell ranges with functions.
I vainly searched some examples.
I wrote the following test. I get "Object variable not set" error on both "for" lines (one is without "RangeAddress", and the second is with it, because I'm not sure of the correct syntax):
function CHECKBZRANGE(cellRange) as integer
dim nCol as integer
dim nLine as integer
dim i as integer
for nCol = cellRange.StartColumn to cellRange.EndColumn
for nLine = cellRange.RangeAddress.StartRow to cellRange.RangeAddress.EndRow
i = i + 1 ' placeholder for some computation
next nLine
next nCol
checkBZ_range = i
end function
This function is called with a cell like =CHECKBZRANGE(A6:C9)
Can someone explain how to use a cell range passed by argument ?