简体   繁体   中英

Is there a way to color selected cells of an Excel file using C#?

I am comparing two excel files cell by cell. One is source file and another is target file.I want to color those cells which are not matching in the target file. Is there any way to do this without creating any other excel sheet for those cells which are not matching. I mean to say I want to fill color in those cells which are not matching in target file..

oResizeRange is a range of cells you selected. It's of type Office.Interop.Excel.Range

oResizeRange.Interior.ColorIndex = someindex;

Source

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM