von arttur » Sa, 20.01.2007 22:46
Sub copyTest1
REM copy a1:b3 from sheet #0 to sheet #1
Dim srcAddr as new com.sun.star.table.CellRangeAddress
Dim tgtAddr as new com.sun.star.table.CellAddress
srcAddr.EndColumn = 0
srcAddr.EndRow = 0
tgtAddr.Sheet = 1
oSh = thiscomponent.getSheets.getByIndex(2) 'any sheet will do
oSh.copyRange(tgtAddr,srcAddr)
REM it should be: thisComponent.copyRange(tgtAddr,srcAddr), since the sheet does not matter
End Sub
Sub copyData
aData=thisComponent.getSheets.getByIndex(0).getCellRangeByPosition(0,0,1,2).getDataArray()
thisComponent.getSheets.getByIndex(1).getCellRangeByPosition(0,0,1,2).setDataArray(aData())
End Sub
kopiert inhalt von A1 sheet1 nach A1 sheet2
Sub copyTest1
REM copy a1:b3 from sheet #0 to sheet #1
Dim srcAddr as new com.sun.star.table.CellRangeAddress
Dim tgtAddr as new com.sun.star.table.CellAddress
srcAddr.EndColumn = 0
srcAddr.EndRow = 0
tgtAddr.Sheet = 1
oSh = thiscomponent.getSheets.getByIndex(2) 'any sheet will do
oSh.copyRange(tgtAddr,srcAddr)
REM it should be: thisComponent.copyRange(tgtAddr,srcAddr), since the sheet does not matter
End Sub
Sub copyData
aData=thisComponent.getSheets.getByIndex(0).getCellRangeByPosition(0,0,1,2).getDataArray()
thisComponent.getSheets.getByIndex(1).getCellRangeByPosition(0,0,1,2).setDataArray(aData())
End Sub
kopiert inhalt von A1 sheet1 nach A1 sheet2