tags:

views:

23

answers:

1

Im trying to copy some cells from one workbook-sheet to another workbook-sheet and preserve the style and formatting using C#.

I can get the attributes one by one like this:

string fontName = ((Excel.Range) workSheet.Cells[3, 2]).Font.Name.ToString();

But Im looking for at way to get it all at once. Thanks

+1  A: 

If you copy the cell(s) via the clipboard using the Range.Copy Destination:= method then both the content and formatting will be copied. If you just want to copy the formatting use .Copy and then .PasteSpecial formats

Charles Williams