21.08.2013 Views

OpenOffice.org BASIC Guide.pdf - OpenOffice.org wiki

OpenOffice.org BASIC Guide.pdf - OpenOffice.org wiki

OpenOffice.org BASIC Guide.pdf - OpenOffice.org wiki

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Editing Spreadsheet Documents 149<br />

Doc = StarDesktop.CurrentComponent<br />

Sheet = Doc.Sheets.getByName("Sheet 1")<br />

CellRange = Sheet.getCellRangeByName("B2:D4")<br />

Cell = CellRange.GetCellByPosition(1, 1)<br />

Formatting Cell Ranges<br />

Just like individual cells, you can apply formatting to cell ranges using the<br />

com.sun.star.table.CellProperties<br />

service. For more information and examples of this service, see → Formatting Spreadsheet<br />

Documents.<br />

Computing With Cell Ranges<br />

You can use the computeFunction method to perform mathematical operations on cell<br />

ranges. The computeFunction expects a constant as the parameter that describes the<br />

mathematical function that you want to use. The associated constants are defined in the<br />

com.sun.star.sheet.GeneralFunction<br />

enumeration. The following values are available:<br />

SUM<br />

COUNT<br />

sum of all numerical values<br />

total number of all values (including non-numerical values)<br />

COUNTNUMS<br />

total number of all numerical values<br />

AVERAGE<br />

MAX<br />

MIN<br />

average of all numerical values<br />

largest numerical value<br />

smallest numerical value<br />

PRODUCT<br />

STDEV<br />

VAR<br />

STDEVP<br />

VARP<br />

product of all numerical values<br />

standard deviation<br />

variance<br />

standard deviation based on the total population

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!