Friday, July 04, 2008  



 FarPoint Technologies
 (800) 645-5913

 fpsales@fpoint.com



     
 »Spread for Windows Forms » Product Tour » Managing Data » Rearranging Data

Previous Rearranging Data on a Sheet Next

You can rearrange data on a sheet from cell to cell in many ways.

  Back to Top
 Copying Data on a Sheet
You can copy data to and from cells using the Copy methods for the sheet.

When you copy data to a cell (or range of cells), the data replaces the data in the destination cell (or cells). If the operation copies a range of cells and pastes them to an overlapping location, the values of all the cells you are pasting are replaced with the values of the cells in the copied range.

Parameters
fromRow Row index of top-left cell in block to copy
fromColumn Column index of top-left cell in block to copy
toRow Row index for destination of upper-left cell in block
toColumn Column index for destination of upper-left cell in block
rowCount Number of rows in the block
columnCount Number of columns in the block
dataOnly Whether only the data is copied, or the data and formatting

' Copy a range of cells
FpSpread1.ActiveSheet.CopyRange(0, 0, 3, 2, 1, 2, False)


  Back to Top
 Moving Data on a Sheet
You can move data from one cell or range of cells to another using the Move methods for the sheet.

When you move data from one cell (or range of cells) to another, the data from the origination cell (or range of cells) replaces the data in the destination cell (or cells). If the operation moves a range of cells to an overlapping location, the values of all the cells of the range are replaced with the values of the cells in the moved range.

Parameters
fromRow Row index of top-left cell in block to move
fromColumn Column index of top-left cell in block to move
toRow Row index for destination of upper-left cell in block
toColumn Column index for destination of upper-left cell in block
rowCount Number of rows in the block
columnCount Number of columns in the block
dataOnly Whether data only or data with formatting are swapped

' Move a range of cells
FpSpread1.ActiveSheet.MoveRange(0, 0, 3, 2, 1, 2, False)


  Back to Top
 Swapping Data on a Sheet
You can swap the contents of two cells or two blocks of cells.

When you swap data from a cell or a range of cells to another cell or range of cells, the settings for the cell are swapped along with the data. For example, if cell A1 contains the value 4 and cell B3 contains the value 6 and you swap the values of the cells, the value of cell A1 becomes 6 and the value of cell B3 becomes 4.

Parameters
fromRow Row index of top-left cell in block to swap
fromColumn Column index of top-left cell in block to swap
toRow Row index for destination of upper-left cell in block
toColumn Column index for destination of upper-left cell in block
rowCount Number of rows in the block
columnCount Number of columns in the block
dataOnly Whether data only or data with formatting are swapped

' Swap a range of cells
FpSpread1.ActiveSheet.SwapRange(0, 0, 3, 0, 3, 3, True)


Previous Rearranging Data on a Sheet Next

    
 Have a question?
Have a Question? Ask Us!
Subscribe to the RSS feed!RSS Subscribe
 

 
SD Times 'TOP 100' Industry Innovator - Read the press release (pdf)

Tour Home
Overview
Appearance
User Interaction
Cell Types
Formulas
Managing Data
Data Binding
Import/Export
Printing
Keyboard Interaction
Shapes
Models
Spread Designer
 
Map

Copyright © 1991-2007 FarPoint Technologies, Inc. All rights reserved. All names are property of their respective owners.