Formatting Excel content using c#

Posted by Santhosh.Nallavelli under C# on 8/9/2012 | Points: 10 | Views : 1260 | Status : [Member] | Replies : 1
I have a excel sheet in which i want to format to the data like in replacing the data , adding background colors .
Please susggest me the solution .




Responses

Posted by: Megan00 on: 8/9/2012 [Member] Starter | Points: 25

Up
0
Down
You can use below code to find and replace excel content :

            CellRange[] ranges = worksheet.FindAllString("Asia", false, false);


foreach (CellRange range in ranges)
{
range.Text = "South American";
}

but you may download this Excel component:http://www.e-iceblue.com/Introduce/excel-for-net-introduce.html
use below code to set excel background :
worksheet.Range["A2:E9"].Style.Color = Color.LightBlue;

worksheet.Range["A11:E18"].Style.Color = Color.Silver;

if you still are not clear ,please see detail : http://everlasting129.weebly.com/1/post/2012/01/how-to-set-background-color-in-excel-for-c-vbnet.html

Never give up! Smile to the world!
http://excelcsharp.blog.com/

Santhosh.Nallavelli, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response