OpenOffice.org BASIC Guide.pdf - OpenOffice.org wiki
OpenOffice.org BASIC Guide.pdf - OpenOffice.org wiki
OpenOffice.org BASIC Guide.pdf - OpenOffice.org wiki
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
Cells and Ranges 132<br />
the columns after the insert position are moved to the right.<br />
The removeRange method is the counterpart to the insertCells method. This method deletes<br />
the range that is defined in the CellRangeAddress structure from the sheet.<br />
Dim Doc As Object<br />
Dim Sheet As Object<br />
Dim CellRangeAddress As New com.sun.star.table.CellRangeAddress<br />
Doc = StarDesktop.CurrentComponent<br />
Sheet = Doc.Sheets(0)<br />
CellRangeAddress.Sheet = 0<br />
CellRangeAddress.StartColumn = 1<br />
CellRangeAddress.StartRow = 1<br />
CellRangeAddress.EndColumn = 2<br />
CellRangeAddress.EndRow = 2<br />
Sheet.removeRange(CellRangeAddress,<br />
com.sun.star.sheet.CellDeleteMode.UP)<br />
This example removes the B2:C3 cell range from the sheet and then shifts the underlying<br />
cells up by two rows. The type of removal is defined by one of the following values from the<br />
com.sun.star.sheet.CellDeleteMode<br />
enumeration:<br />
NONE<br />
UP<br />
LEFT<br />
ROWS<br />
the current values remain in their current position.<br />
the cells at and below the insert position are moved upwards.<br />
the cells at and to the right of the insert position are moved to the left.<br />
the rows after the insert position are moved upwards.<br />
COLUMNS<br />
the columns after the insert position are moved to the left.<br />
The XRangeMovement interface provides two additional methods for moving (moveRange)<br />
or copying (copyRange) cell ranges. The following example moves the B2:C3 range so that<br />
the range starts at position A6:<br />
Dim Doc As Object<br />
Dim Sheet As Object<br />
Dim CellRangeAddress As New com.sun.star.table.CellRangeAddress