Jump to content

Macros/Guía de Python/Calc/Rangos de celdas

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.

⇐ Volver a la Guía de Python, Calc

Rangos

PRECAUCIÓN: Copie o importe la función msgbox que se describe en Funciones útiles

Obtener una celda por nombre

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

Obtener una celda por posición.

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

⇐ Volver a la Guía de Python, Calc