Where's the "Shift+Home" equivalent for columns?

Is there a way to select all cells in a column above the current cell?.

The LibreOffice help page provides

Shift+Home = Selects cells from the current cell to the first cell of the current row.

but there doesn’t seem to be an equivalent for column selection. Nearest I can find is “Shift+Page Up” but this only selects cells up to the first empty cell.

Apologies if this is an obvious oversight on my behalf :face_with_monocle:

7.3.7.2 / LibreOffice Community
Build ID: 30(Build:2)
Linux 5.15

You may hold Shift+PgUp until the selection reaches the first cell of the column or use a simple macro:

Sub select_until_column_top()
oView = ThisComponent.getCurrentController()
oCell = getActiveCell(oView)
addr = oCell.getRangeAddress()
addr.StartRow = 0
rg = getRangeByAddress(ThisComponent, addr)
oView.select(rg)
End Sub

Function getRangeByAddress(obj, oAddr as com.sun.star.table.CellRangeAddress)
on error goto nullErr:
Dim oSheet
	If obj.supportsService("com.sun.star.sheet.SpreadsheetDocument") then
		REM use the sheet specified by given address
		oSheet = obj.getSheets.getByIndex(oAddr.Sheet)
	else
		REM use given object (range/sheet) as parent range
		oSheet = obj
	endif
	getRangeByAddress = oSheet.getCellRangeByPosition(oAddr.StartColumn,oAddr.StartRow,oAddr.EndColumn,oAddr.EndRow)
exit function
nullErr:
	getRangeByAddress = Null
End Function

Function getActiveCell(Optional oView )
Dim as1(), lSheet&,lCol&,lRow$, sDum as String,bErr as Boolean
If isMissing(oView) then oView = ThisComponent.getCurrentController()
	as1()  = Split(oView.ViewData, ";")
	lSheet = CLng(as1(1))
	sDum = as1(lSheet +3)
	as1() = Split(sDum, "/")
	on error goto errSlash
		lCol = CLng(as1(0))
		lRow = CLng(as1(1))
	on error goto 0
	getActiveCell = oView.Model.getSheets.getByIndex(lSheet).getcellByPosition(lCol,lRow)
exit Function
errSlash:
	if NOT(bErr) then
		bErr = True
		as1() = Split(sDum, "+")
		resume
	endif
End Function
1 Like

The Shift-PgUp selects all cells for me in a column above the active cell.
LO 7.5.8

PgUp/Down jumps one screen full of cells. You may need to hold Shift+PgUp until the selection reaches the first cell.

I only get one page at a time, as @Villeroy mentions, but holding Shift+PgUp is pretty quick (only 5000 rows).

You may hold Shift+Ctrl+Up (which jumps to the next transition of empty/non-empty cells) until selected to the top. If all cells above are filled in the column it’s just a one time operation.

Similar with Shift+Ctrl+Left / Shift+Ctrl+Right / Shift+Ctrl+Down.

1 Like