[Solved] Make multiple cells blink

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Locked
jainagirl
Posts: 11
Joined: Mon Apr 06, 2009 9:46 pm

[Solved] Make multiple cells blink

Post by jainagirl »

I'm using the following macro that I got some time ago from a OO or LO forum:

Sub Blink_It
oSheet = ThisComponent.Sheets(0)
oCell = oSheet.getCellRangeByName("H2529")
Do While True
ocell.CellBackColor = RGB(255,255,255)
'White
Wait 1000
'wait 1000 milliseconds
ocell.CellBackColor = RGB(255,255,51)
'Yellow
Wait 1000
'wait 1000 milliseconds
Loop
End Sub

The problem is, I also want cell H2531 to blink as well. Any suggestions? Thanks in advance.
Last edited by Hagar Delest on Tue Jul 22, 2025 7:55 am, edited 1 time in total.
OOo 3.0.X on Ms Windows XP
Alex1
Volunteer
Posts: 837
Joined: Fri Feb 26, 2010 1:00 pm
Location: Netherlands

Re: Make Multiple Cells Blink

Post by Alex1 »

I don't know if this is the easiest way, but it should work:

Code: Select all

Sub Blink_It
oSheet = ThisComponent.Sheets(0)
oCell = oSheet.getCellRangeByName("H2529")
oCell2 = oSheet.getCellRangeByName("H2531")
Do While True
ocell.CellBackColor = RGB(255,255,255)
ocell2.CellBackColor = RGB(255,255,255)
'White
Wait 1000
'wait 1000 milliseconds
ocell.CellBackColor = RGB(255,255,51)
ocell2.CellBackColor = RGB(255,255,51)
'Yellow
Wait 1000
'wait 1000 milliseconds
Loop
End Sub
AOO 4.1.15 & LO 25.2.5 on Windows 10
jainagirl
Posts: 11
Joined: Mon Apr 06, 2009 9:46 pm

Re: Make Multiple Cells Blink

Post by jainagirl »

Works like a charm! Such a simple solution! Thanks so much!
OOo 3.0.X on Ms Windows XP
Locked