Hello,
i need to count the cell with the same background color in a range of cell.
The range is define as :
oRange = sheet.getCellRangeByPosition(7, nRiga+startIndex, 8, nRiga+stopIndex)
and in this range i use a condition
oRed4Condition(0).Name = "Operator"
oRed4Condition(0).Value = com.sun.star.sheet.ConditionOperator.NOT_BETWEEN
oRed4Condition(1).Name = "Formula1"
oRed4Condition(1).Value = climit
oRed4Condition(2).Name = "Formula2"
oRed4Condition(2).Value = "-" + climit
oRed4Condition(3).Name = "StyleName"
oRed4Condition(3).Value = "Senza nome1"
I want to count the cells that are true for this condition.
i’m tring with
for each c In oRange.CellFormatRanges
if (c.CellBackColor = oRed4Condition(3).Value) then
checkResult = checkResult + 1
endif
next c
but oRange.CellFormatRanges is not correct… how i can loop all cell and check this condition?
Thanks
Daniele
(Edited for better readability by @Lupp )