マクロ/Pythonガイド/Calc/Calc範囲

From The Document Foundation Wiki
Jump to navigation Jump to search
This page is a translated version of the page Macros/Python Guide/Calc/Calc ranges and the translation is 50% complete.
Other languages:
English • ‎español • ‎italiano • ‎日本語

目次に戻る

範囲

CAUTION: Copy or import function msgbox from Useful functions

Get cell by name

1    doc = XSCRIPTCONTEXT.getDocument()
2    sheet = doc.CurrentController.ActiveSheet
3    cell = sheet['A1']
4    msgbox(cell.AbsoluteName)

Get cell by position

1    doc = XSCRIPTCONTEXT.getDocument()
2    sheet = doc.CurrentController.ActiveSheet
3    # Cell C6
4    row = 5
5    column = 2
6    cell = sheet[row,column]
7    msgbox(cell.AbsoluteName)