I have read a few post on this issue, even downloaded the examples. However, I couldn't get it to work for my needs.
My range is from b6 : t301
I would like the entire row within that range by highlighted either with a black border or all cells in Sky Blue, when a cell is clicked within that row.
I just don't get how to do this.
Any help or guidance would be appreciated.
[SOLVED] Highlight entire row with the active cell
[SOLVED] Highlight entire row with the active cell
Last edited by MrProgrammer on Sun Mar 28, 2021 4:50 am, edited 4 times in total.
Reason: Add green tick
Reason: Add green tick
OpenOffice Win 10
Re: Highligting Row
If you want the entire row, then your range has to include the entire row.
Your range only goes from column B to column T. A full row goes from A to AMJ
Aside from that, I can't help as I don't understand what it is you are trying to do. By default only the single cell that the cursor is in is highlighted when the cursor is moved.
Your range only goes from column B to column T. A full row goes from A to AMJ
Aside from that, I can't help as I don't understand what it is you are trying to do. By default only the single cell that the cursor is in is highlighted when the cursor is moved.
OpenOffice 4.1.7, LibreOffice 7.0.1.2 on Windows 7 Pro, Ultimate & Windows 10 Home (2004)
If you believe your problem has been resolved, please go to your first post in this topic, click the Edit button and add [Solved] to the beginning of the Subject line.
If you believe your problem has been resolved, please go to your first post in this topic, click the Edit button and add [Solved] to the beginning of the Subject line.
Re: Highligting Row
Try it...
Run RegisterMouseClickHandler. UnregisterMouseClickHandler to stop working.
Additional column highlighting commented out by 'Rem'.
Run RegisterMouseClickHandler. UnregisterMouseClickHandler to stop working.
Additional column highlighting commented out by 'Rem'.
Code: Select all
Global oDocView, oMouseClickHandler
Sub RegisterMouseClickHandler
oDocView = ThisComponent.currentController
oMouseClickHandler = createUnoListener("MyApp_","com.sun.star.awt.XMouseClickHandler")
oDocView.addMouseClickHandler(oMouseClickHandler)
End Sub
Sub UnregisterMouseClickHandler
oDocView.removeMouseClickHandler(oMouseClickHandler)
End Sub
Sub MyApp_disposing
End Sub
Function MyApp_mousePressed(oEvt) As Boolean
MyApp_mousePressed=False
End Function
Function MyApp_mouseReleased(oEvt) As Boolean
MyApp_mouseReleased=False
On Error Resume Next
oCell = ThisComponent.CurrentSelection
oRanges = ThisComponent.createInstance("com.sun.star.sheet.SheetCellRanges")
Rem oCol = oCell.Columns.getByIndex(0).RangeAddress
oRow = oCell.Rows.getByIndex(0).RangeAddress
oRanges.addRangeAddresses(Array(oCell.RangeAddress, oCol, oRow), False)
ThisComponent.CurrentController.select(oRanges)
End Function
Ubuntu 18.04 LTS • LibreOffice 7.5.3.2 Community
Re: Highligting Row
You have extra lines in the screenshot there.
Ubuntu 18.04 LTS • LibreOffice 7.5.3.2 Community