Я понял, как выделить первые 3 символа.
Sub SelectTextInCell
Dim oCell, oSheet, oCursor, oVCurs
oSheet = thisComponent.CurrentSelection.getSpreadsheet
oCell = oSheet.GetCellbyPosition(0, 0)
ThisComponent.CurrentController.Select(oCell) ' выделение ячейки
oCell.setString("12345")
oCursor=oCell.Text.createTextCursor()
oCursor.gotoStart(False) ' на начало текста
oCursor.goRight(3, true)
oCursor.CharBackColor = RGB(0,0,0)
oCursor.CharColor = RGB(255,255,255)
MsgBox oCursor.getString
oCursor.CharColor = RGB(0,0,0)
oCursor.CharBackColor = RGB(255,255,255)
End Sub