Codice: Seleziona tutto
Sub Search_RETT_INV3
Dim LB
Dim oCell
Dim oFilterDesc
Dim oTextBox
Dim oFields(0) As New com.sun.star.sheet.TableFilterField2
Sheet = ThisComponent.Sheets(1)
oTextBox = oDialogo2.getControl("ComboBox4")
LB = oDialogo2.getControl("ListBox1")
LB.removeItems(0,LB.getItemCount())
Daric = UCase(oTextBox.Text)
c = Sheet.createCursor
c.gotoEndOfUsedArea(false)
LastRow = c.RangeAddress.EndRow + 1
CellRange = Sheet.getCellRangeByName("E1:E" & LastRow)
oFilterDesc = CellRange.createFilterDescriptor(True)
With oFields(0)
.Field = 0
.Operator = com.sun.star.sheet.FilterOperator2.BEGINS_WITH
.StringValue = Daric
End With
oFilterDesc = CellRange.createFilterDescriptor(True)
With oFilterDesc
.ContainsHeader = False
.CopyOutputData = False
.FilterFields2 = oFields()
End With
CellRange.filter(oFilterDesc)
ranges = CellRange.queryVisibleCells()
If Ubound(ranges.RowDescriptions) > -1 Then
ReDim Arr(0 To Ubound(ranges.RowDescriptions))
Dim a(0 To Ubound(ranges.RowDescriptions))
For Each oCell in ranges.Cells
Arr(x) = oCell.CellAddress.Row
a(x) = oCell.DataArray(0)
x = x +1
Next
Dati = a
svc = createUnoService("com.sun.star.sheet.FunctionAccess")
Dati1 = svc.callFunction("TRANSPOSE", Array(a))
LB.getModel.StringItemList = Dati1(0)
End If
'Call RemoveSheetFilter2()
End sub
Codice: Seleziona tutto
Dati1 = svc.callFunction("TRANSPOSE", Array(a))
Mi potreste aiutare?
e seconfo voi può essere legato all'hardware installato nel pc.
Grazie Mille
Luca