Search Results for

    Show / Hide Table of Contents

    ExcelFile.MoveRange Method

    Overloads

    • ExcelFile.MoveRange(TXlsCellRange, Int32, Int32, TFlxInsertMode)
    • ExcelFile.MoveRange(TXlsCellRange, Int32, Int32, TFlxInsertMode, Boolean)

    ExcelFile.MoveRange(TXlsCellRange, Int32, Int32, TFlxInsertMode)

    Moves a range of cells, the same way Excel does it. All references pointing to the old range will be relocated to the new, and all existing references to the new range will be relocated to #ref.

    Syntax

    Namespace: FlexCel.Core

    public void MoveRange(TXlsCellRange cellRange, Int32 newRow, Int32 newCol, TFlxInsertMode insertMode)

    Parameters

    <-> Parameter Type Description
    cellRange TXlsCellRange Range you want to move.
    newRow Int32 Row where the range will be relocated.
    newCol Int32 Column where the range will be relocated.
    insertMode TFlxInsertMode This parameter switches between 2 different working modes:
    * Modes NoneDown and NoneRight are the same, and work the same way as when you drag a range of cells in Excel to a new location. Cells on the new range will be replaced by the old, and cells where the old range was located will be cleared(not deleted).
    No cells are inserted or deleted.

    * The other modes behave like when you select a range in Excel, cut it, and then right click and select "Insert Cut Cells...". The old range will be inserted where the new range goes, cells where the old range was will be deleted(not cleared).
    Using for example MoveRange(CellRange, newRow, newCol, TFlxInsertMode.ShiftRight) is equivalent to: 1) InsertAndCopyRange(CellRange, newRow, newCol, 1, TFlxInsertMode.ShiftRight, TRangeCopyMode.None); 2) MoveRange(CellRange, newRow, newCol, TFlxInsertMode.NoneRight); 3) DeleteRange(CellRange, TFlxInsertMode.ShiftRight);

    See also

    • ExcelFile

    ExcelFile.MoveRange(TXlsCellRange, Int32, Int32, TFlxInsertMode, Boolean)

    Moves a range of cells, the same way Excel does it. All references pointing to the old range will be relocated to the new, and all existing references to the new range will be relocated to #ref.

    Syntax

    Namespace: FlexCel.Core

    public abstract void MoveRange(TXlsCellRange cellRange, Int32 newRow, Int32 newCol, TFlxInsertMode insertMode, Boolean fixAllFormulas)

    Parameters

    <-> Parameter Type Description
    cellRange TXlsCellRange Range you want to move.
    newRow Int32 Row where the range will be relocated.
    newCol Int32 Column where the range will be relocated.
    insertMode TFlxInsertMode This parameter switches between 2 different working modes:
    * Modes NoneDown and NoneRight are the same, and work the same way as when you drag a range of cells in Excel to a new location. Cells on the new range will be replaced by the old, and cells where the old range was located will be cleared(not deleted).
    No cells are inserted or deleted.

    * The other modes behave like when you select a range in Excel, cut it, and then right click and select "Insert Cut Cells...". The old range will be inserted where the new range goes, cells where the old range was will be deleted(not cleared).
    Using for example MoveRange(CellRange, newRow, newCol, TFlxInsertMode.ShiftRight) is equivalent to: 1) InsertAndCopyRange(CellRange, newRow, newCol, 1, TFlxInsertMode.ShiftRight, TRangeCopyMode.None); 2) MoveRange(CellRange, newRow, newCol, TFlxInsertMode.NoneRight); 3) DeleteRange(CellRange, TFlxInsertMode.ShiftRight);

    fixAllFormulas Boolean If true (the default) FlexCel will correctly adapt all the references in all formulas everywhere. If false only the formulas being moved will be changed. The results with this parameter = false are incorrect if you have formulas pointing to the range moved, but is faster if you know no formulas point to cells inside the range moved.
    You should normally keep this parameter = true. FlexCel uses it false to emulate the way Excel sorts (which is wrong).

    See also

    • ExcelFile
    In This Article
    Back to top FlexCel Studio for the .NET Framework v7.24.0.0
    © 2002 - 2025 tmssoftware.com