Help with Search Descriptor and FindAll()

Can someone explain how to use a Search Descriptor and FindAll() in order to determine if all cells in the same column contain the same exact value?

oSelection = oConstantSheet.getCellRangeByPosition(iColumn, iStartRow, iColumn, iRowCount) 'nLeft, nTop, nRight, nBottom
    'nLeft	is the column index of the first cell inside the range.
    'nTop	is the row index of the first cell inside the range.
    'nRight	is the column index of the last cell inside the range.
    'nBottom	is the row index of the last cell inside the range.
 
oDescriptor = oSelection.createSearchDescriptor()
oDescriptor.SearchString = sConstantValue
oDescriptor.SearchWords = True
oFoundAll = oSelection.FindAll(oDescriptor)

I don’t know how to access oFoundAll in order to find out how many sConstantValue were found

I didn’t try, but your oFoundAll should be an object with a .Count property and a .GetByIndex method. Indices are zero-based.

Method findAll() is from XSearchable and returns XIndexAccess with method getCount().

If oFoundAll.getCount() = iRowCount Then
    'Add code here'
End If

Also, your code does not look right, because the fourth parameter to getCellRangeByPosition() is the final row index, not a row count. Try this instead.

oSelection = oConstantSheet.getCellRangeByPosition(_
    iColumn, iStartRow, iColumn, iStartRow + iRowCount - 1)