Link Search Menu Expand Document

SSpread.SwapColRange Method

Explanation Swaps the specified column range with another column range.

Swap the data and format of the column range. The number of columns to be replaced is the same as the range of columns to be replaced.

Use the SwapRange method to swap cell ranges and the SwapRowRange method to swap rows. The column range can be copied or moved using the CopyRowRange and MoveColRange methods.
Call format SwapColRange(col, col2, coldest)
Return value None
Arguments col Column number at the beginning of the column range of the swap source
col2 Last column number in the source column range
coldest Column number at the beginning of the column range of the swap destination
Exception EXT-28 An error occurred in the SwapColRange method
Example of use
    BlockMode = $TRUE;
    Col = 2;
    Row = 2;
    Col2 = 4;
    Row2 = 4;
    Text = "sample";
    BackColor = $GREEN;
    Col = 6;
    Col2 = 8;
    Text = "sample2";
    BackColor = $RED;
    BlockMode = $FALSE;
    
    SwapColRange(2, 3, 6);
    
Related item CopyColRange, CopyRowRange, MoveColRange, MoveRowRange, SwapRange, SwapRowRange methods