Quantcast
Channel: Apache OpenOffice Community Forum
Viewing all articles
Browse latest Browse all 1281

Macros and UNO API • Re: Help With Macro Execution in Calc

$
0
0
Hallo
of course its python, dont use it :lol:

Code:

def round_robin(event):    """    toggle Cell_Color »no color« ⇒ »red« ⇒ »green«    restricted to Rows <= 21 and Columns A to F    """    COLORS = (-1, int("ff0000", 16), int("00ff00", 16)) #None, red, green     div = len(COLORS)    address = event.CellAddress    if (address.Row >20) or (address.Column > 5):        return    if ( c:=event.CellBackColor) in COLORS:        event.CellBackColor = COLORS[(COLORS.index(c) + 1) % div]        return

Statistics: Posted by karolus — Sun Jul 21, 2024 12:15 pm



Viewing all articles
Browse latest Browse all 1281

Trending Articles