1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
| Option Explicit
Sub Tri1
Dim oDoc as Object, fBase as Object, fSel1 as Object, fSel2 as Object
Dim maZone as Object, oFilterDesc as Object, maCellule as Object
Dim oFields(0) As New com.sun.star.sheet.TableFilterField
Dim CellVides as Variant, y as Long
oDoc = thisComponent
fBase = oDoc.Sheets.getByName("Tri O_U Today")
fSel1 = oDoc.Sheets.getByName("Selection Over Today")
fSel2 = oDoc.Sheets.getByName("Selection Under Today")
maZone = fBase.getCellRangeByName("A1:A1000")
CellVides = maZone.queryEmptyCells.RangeAddresses
y = CellVides(UBound(CellVides)).StartRow
maZone = fBase.getCellRangeByName("A1:Ak" & y)
oFilterDesc = maZone.createFilterDescriptor(True)
With oFields(0)
.Field = 36
.IsNumeric = True
.NumericValue = 1.8
.Operator = com.sun.star.sheet.FilterOperator.GREATER_EQUAL
End With
With oFilterDesc
.CopyOutputData = True
.ContainsHeader = False
.Orientation = com.sun.star.table.TableOrientation.COLUMNS
maCellule = fSel1.getCellRangeByName("A1")
.OutputPosition = maCellule.CellAddress
.FilterFields = oFields()
End With
maZone.filter(oFilterDesc)
oFilterDesc = maZone.createFilterDescriptor(True)
With oFields(0)
.Field = 36
.IsNumeric = True
.NumericValue = 0.2
.Operator = com.sun.star.sheet.FilterOperator.LESS
End With
With oFilterDesc
.CopyOutputData = True
.ContainsHeader = False
.Orientation = com.sun.star.table.TableOrientation.COLUMNS
maCellule = fSel2.getCellRangeByName("A1")
.OutputPosition = maCellule.CellAddress
.FilterFields = oFields()
End With
maZone.filter(oFilterDesc)
End Sub |
Partager