如何在c#中加粗并为backcel表单单元格值赋予backcolor? [英] How to bold and give backcolor to excel sheet cell value in c#?

查看:89
本文介绍了如何在c#中加粗并为backcel表单单元格值赋予backcolor?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hi,

I am generating  excel sheet from c#.net. I did everything except one thing.I have a row headers like AccountNumber,AccountHolderName,AccountHolderAddress,AccountHolderBranch.

I want to find them runtime using c# code and if those headers are available on that excel then i need to make them bold.

Also find some headers and make them background color and bold.

Is anyone did this, then please share with me as google does not having exact solution as such?

Thanks!

推荐答案

通过使用Range,您可以设置粗体和背景颜色

By using Range you can set bold and backcolor
 Excel.Range chartRange ;
chartRange = xlWorkSheet.get_Range("b4", "e4");
            chartRange.Font.Bold = true;



其中b4和e4表示单元格索引你想要大胆



希望这有帮助


where b4 and e4 means the cell index you want to bold

Hope this helps


这篇关于如何在c#中加粗并为backcel表单单元格值赋予backcolor?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆