[Solved] Specify current cell in macro

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

[Solved] Specify current cell in macro

Post by jainagirl »

Hello, all:

Is there a way to edit this macro so it refers to the current cell at cursor position, rather than cell D2109?

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

Thanks in advance :)
Last edited by MrProgrammer on Tue Jan 21, 2025 2:58 am, edited 1 time in total.
Reason: Tagged ✓ [Solved] -- MrProgrammer, forum moderator
OOo 3.0.X on Ms Windows XP
User avatar
Zizi64
Volunteer
Posts: 11476
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Specify Current Cell in Macro

Post by Zizi64 »

Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
Locked