Hi Paolo,

Paolo Mantovani schrieb:

The following sub should have the same effect of your original SelectCurrentRange

Thank you. It is not exactly the same effect, because the current region should only be selected if the current selection contains one single cell. Otherwise, if the current selection contains a range of more than one cell, the selection must not be changed.

sub SelectCurrentRegion
Dim oDoc, oSheet, oSelection, oCursor

        oDoc = ThisComponent
        oSheet = oDoc.CurrentController.ActiveSheet
        oSelection = oDoc.CurrentSelection
        
        oCursor = oSheet.createCursorByRange(oSelection)
        oCursor.collapseToCurrentRegion()
        oDoc.CurrentController.select(oCursor)
        
End Sub

So there needs to be added some if-clause regarding the number of rows or columns in the current selection. That´s easy for me, I think.

Stefan


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to