Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as Python by Punya ( 19 years ago )
import uno, unohelper

def test(*args):
    """Scratchpad for learning about OOo scripting."""
    sheets = XSCRIPTCONTEXT.getDocument().Sheets
    cp, gene, test, cellType, linear = map(sheets.getByName, ['CP', 'Gene', 'Test', 'CellType', 'Linear'])
    def cell(s, x, y): return s.getCellByPosition(x, y).getFormula()
    def setcell(s, x, y, v): s.getCellByPosition(x, y).setFormula(v)
    for col in xrange(16):
        for row in xrange(24):
            drow = col * 24 + row + 1
            for dcol, sheet in [(0, cellType), (1, gene), (2, test), (3, cp)]:
                setcell(linear, dcol, drow, cell(sheet, row, col))

# what i'd like to do there, of course was
linear = [[x[col, row] for x in [cellType, gene, test, cp]] for (col, row) in xrange2(16, 24)]

 

Revise this Paste

Your Name: Code Language: