Jump to content

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

From The Document Foundation Wiki
This page is a translated version of the page Macros/Python Guide/Calc/Calc ranges and the translation is 100% complete.

⇐ Pythonガイド/Calc に戻る

範囲

注意: 便利な関数から、関数 msgbox をコピー、あるいは、インポートします。

名前からセルを取得する

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

位置からセルを取得する

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

⇐ Pythonガイド/Calc に戻る