Formatting Excel content using c#

Posted by Santhosh.Nallavelli under C# on 8/9/2012 | Points: 10 | Views : 1392 | 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 .


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

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:
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 :

Never give up! Smile to the world!

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

Login to post response