Free Support Forum - aspose.com

Format cells (merge cells)

I have a workbook with two worksheets. I copy rows from the second sheet to the first sheet as follows.

         Row += 1
         Sheet.Cells.CopyRow(TemplateSheet.Cells, 9, Row)
 
Next I place data in cells
 
         Sheet.Cells(Row, 1).PutValue(Sales.Items(Item).Seller.City)
         Sheet.Cells(Row, 2).PutValue(Sales.Items(Item).Seller.State)
         Sheet.Cells(Row, 3).PutValue(Sales.Items(Item).Seller.ZipCode)
         Sheet.Cells(Row, 5).PutValue(Sales.Items(Item).Seller.Country)
 
This is repeated and works fine until I come to a cell that in the template
(second sheet) has three cells set to merge and word wrap. When copied to 
sheet one, let's say B40-F42 the merge cells and word wrap do not follow to
sheet one.
 
So I am trying to learn how to copy a row from sheet two to sheet one with
merge cells and wordwrap in tact.

Okay I figured it out. I was using Cells.Merge and interpreting the third param as which row to stop at instead of how many rows down. I am fine now.