1 diff --git sc/source/ui/vba/vbarange.cxx sc/source/ui/vba/vbarange.cxx
2 index 19bf089..9743989 100644
3 --- sc/source/ui/vba/vbarange.cxx
4 +++ sc/source/ui/vba/vbarange.cxx
5 @@ -3317,7 +3317,6 @@ ScVbaRange::characters( const uno::Any& Start, const uno::Any& Length ) throw (u
7 ScVbaRange::Delete( const uno::Any& Shift ) throw (uno::RuntimeException)
10 if ( m_Areas->getCount() > 1 )
12 sal_Int32 nItems = m_Areas->getCount();
13 @@ -3329,6 +3328,8 @@ ScVbaRange::Delete( const uno::Any& Shift ) throw (uno::RuntimeException)
16 sheet::CellDeleteMode mode = sheet::CellDeleteMode_NONE ;
17 + RangeHelper thisRange( mxRange );
18 + table::CellRangeAddress thisAddress = thisRange.getCellRangeAddressable()->getRangeAddress();
19 if ( Shift.hasValue() )
22 @@ -3346,13 +3347,17 @@ ScVbaRange::Delete( const uno::Any& Shift ) throw (uno::RuntimeException)
26 - if ( getRow() > getColumn() )
28 + bool bFullRow = ( thisAddress.StartColumn == 0 && thisAddress.EndColumn == MAXCOL );
29 + sal_Int32 nCols = thisAddress.EndColumn - thisAddress.StartColumn;
30 + sal_Int32 nRows = thisAddress.EndRow - thisAddress.StartRow;
31 + if ( mbIsRows || bFullRow || ( nCols >= nRows ) )
32 mode = sheet::CellDeleteMode_UP;
34 mode = sheet::CellDeleteMode_LEFT;
35 - RangeHelper thisRange( mxRange );
37 uno::Reference< sheet::XCellRangeMovement > xCellRangeMove( thisRange.getSpreadSheet(), uno::UNO_QUERY_THROW );
38 - xCellRangeMove->removeRange( thisRange.getCellRangeAddressable()->getRangeAddress(), mode );
39 + xCellRangeMove->removeRange( thisAddress, mode );