Den lör 23 maj 2026 kl 19:54 skrev nine9feet <nine9feet@nine9feet.com>:
Try as follows from the manual :
" Home moves the cell focus to the start of a row. Ctrl+Home moves the cell
focus to the
first cell in the sheet, A1"
HTH
I don't understand why he would try any of that, since none of that is what
he wants to do. He wants to move to the top of the column.
Of course you can do that by repeatedly hitting Page Up, but I guess that's
not what he was looking for.
On Sat, 23 May 2026 at 18:49, Jarek Krcmar <jarek.krcmar@email.cz> wrote:
Good evening team,
I write this message to you, because I would know, how to return to the
cell for example B1, if I am on the cell B13.
If I will use Ctrl + Home, I will be on the cell A1. (In this moment I
doesn't need it.)
Could you give me an advice, please?
Does exist hotkey for it?
No, you have to create your own, I'm afraid, unless you are happy with
hitting PageUp repeatedly until you reach the first row of that column.
You can write a macro for it, a macro that just checks the current
selection, set the row to 0 and selects that. Then you can assign that
macro to whatever keyboard shortcut (or menu, or toolbar, or event, or
whatever) you like.
The macro should be very simple, something like:
Option Explicit
Sub SelectFirstRowOfActiveColumn()
Dim oCurrentSelection As Object
Dim oActiveCell As Object
Dim oSheet As Object
Dim lTargetColumn As Long
Dim oTargetCell As Object
' Get the current selection in the document
oCurrentSelection = ThisComponent.getCurrentSelection()
' Ensure the selection is a single cell or a range
If
oCurrentSelection.supportsService("com.sun.star.sheet.SheetCellRange") Then
' Get the active sheet
oSheet = ThisComponent.getCurrentController().getActiveSheet()
' Get the column index of the top-left cell in the current selection
lTargetColumn = oCurrentSelection.getRangeAddress().StartColumn
' Get the cell in row 1 (index 0) of that column
oTargetCell = oSheet.getCellByPosition(lTargetColumn, 0)
' Select the target cell
ThisComponent.getCurrentController().select(oTargetCell)
End If
End Sub
The code above was generated by AI, and I didn't test it, but I see nothing
wrong with it, so I think it might work. If not, I guess we could dive into
it and fix it.
If it works and you want to assign it to a keyboard shortcut, you can do
that at ”Tools → Customise → Keyboard”.
For this to work in all Calc files, you need to make the macro global.
Here's the whole procedure:
Tools → Macros → Organise macros → Basic
In the left pane in the new window that pops up, select My macros and
dialogues → Standard
Hit New
the Basic IDE opens and there's some code:
Sub Macro1
End Sub
Just replace this with the code above.
To test it, select a cell in your spreadsheet and start the macro by
placing the cursor somewhere inside the macro code and hit F5. The top cell
of that column should now be selected.
Ok, since I wrote all this text, I actually had to test the code, and yes,
it works.
Kind regards
Johnny Rosenberg
Sincerely
--
Jarek
--
To unsubscribe e-mail to: users+unsubscribe@global.libreoffice.org
Problems?
https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more:
https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy
--
To unsubscribe e-mail to: users+unsubscribe@global.libreoffice.org
Problems?
https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy
--
To unsubscribe e-mail to: users+unsubscribe@global.libreoffice.org
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy
Context
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.