Thanks, I have thousands of sn to select,so I saw some code like this, but not sure, if I can copy and paste my thousands sn in it:
sub DeleteRows()
dim oSheet as object
dim oCellCursor as object, oCellRangeAddress as object, oCell as object
dim lRowNumber as long, lEndRow as long
oSheet = thiscomponent.currentController.activesheet
oCellCursor = oSheet.createCursor()
' Find the last used row '
oCellCursor.gotoEndOfUsedArea(True)
oCellRangeAddress = oCellCursor.getRangeAddress()
lEndRow = oCellRangeAddress.EndRow
'from the bottom to the top, one row at a time '
for lRowNumber = lEndRow to 1 step -1
' if cell in col D = 5 '
oCell = oSheet.getCellByPosition(3, lRowNumber)
if oCell.value = 5 then
' if cell in col H = empty '
oCell = oSheet.getCellByPosition(7, lRowNumber)
if oCell.Type = com.sun.star.table.CellContentType.EMPTY then
oSheet.rows.removeByIndex(lRowNumber, 1)
end if
end if
next lRowNumber
print "done"
end sub