is there a shortcut to open the first sheet? The closest ive found is “Ctrl+Page Up” which Moves one sheet to the left, but I want to move to the first sheet instead Shortcut Keys for Spreadsheets - LibreOffice Help
I’m afraid you will need a little macro and assign it to the preferred shortcut via
The following macro would do what you want:
Sub makeFirstSheetActive() On Local Error Goto fail REM Will exit if you call the macro for a non-Calc document. doc = ThisComponent cCtrl = doc.CurrentController cCtrl.setActiveSheet(doc.Sheets(0)) fail: End Sub
many thanks! So if you wanted to open 2nd sheet you’d change it to (doc.Sheets(1)) am I right?
That’s right. The internal sheet indices are 0-based.
If you want to make a sheet active based on its “ordinary” 1-based number instead of its name (for which purpose there is the
>Edit>Select>Sheets... menu path), you can use
zeroBasedSheetIndex = -1 + InputBox("Enter the 1-based number of the sheet:", "Select next active sheet by number", 1).
The default number (1 above) you may replece by a different constant or by a variable/expression …
Sub Plan1 dim plan(0) as new com.sun.star.beans.PropertyValue plan(0).Name = "Nr" : plan(0).Value = 1 CreateUnoService("com.sun.star.frame.DispatchHelper") _ .executeDispatch(ThisComponent.CurrentController _ .Frame, ".uno:JumpToTable", "", 0, plan()) End Sub