在excel中,多个细胞如何处于边界样式 [英] in excel how the mutiple cells to be in border style

查看:76
本文介绍了在excel中,多个细胞如何处于边界样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在excel多个单元格中处于边框样式。



我的代码如下;





in excel mutiple cells to be in border style.

my code as follows;


chartRange = xlWorkSheet.get_Range("A" + xlRow, "A" + xlRow);
                     chartRange.BorderAround(Excel.XlLineStyle.xlContinuous, Excel.XlBorderWeight.xlMedium, Excel.XlColorIndex.xlColorIndexAutomatic, Excel.XlColorIndex.xlColorIndexAutomatic);
                     chartRange = xlWorkSheet.get_Range("B" + xlRow, "B" + xlRow);
                     chartRange.BorderAround(Excel.XlLineStyle.xlContinuous, Excel.XlBorderWeight.xlMedium, Excel.XlColorIndex.xlColorIndexAutomatic, Excel.XlColorIndex.xlColorIndexAutomatic);
                     chartRange = xlWorkSheet.get_Range("C" + xlRow, "C" + xlRow);
                     chartRange.BorderAround(Excel.XlLineStyle.xlContinuous, Excel.XlBorderWeight.xlMedium, Excel.XlColorIndex.xlColorIndexAutomatic, Excel.XlColorIndex.xlColorIndexAutomatic);
                     chartRange = xlWorkSheet.get_Range("D" + xlRow, "D" + xlRow);
                     chartRange.BorderAround(Excel.XlLineStyle.xlContinuous, Excel.XlBorderWeight.xlMedium, Excel.XlColorIndex.xlColorIndexAutomatic, Excel.XlColorIndex.xlColorIndexAutomatic);
                     chartRange = xlWorkSheet.get_Range("E" + xlRow, "E" + xlRow);
                     chartRange.BorderAround(Excel.XlLineStyle.xlContinuous, Excel.XlBorderWeight.xlMedium, Excel.XlColorIndex.xlColorIndexAutomatic, Excel.XlColorIndex.xlColorIndexAutomatic);
                     xlRow = xlRow + 1;





当我输入上面的代码输出如下;



AFF

日期Session1 Session2 Session3 Session4

14/1/2013 cm rk vk

15 // 2013 MK Rj GS

16/1/2013 RK CM VK。





来自输出的边框仅限如下;





14/1/2013 cm rk vk

15 // 2013 MK Rj GS

16/1/2013 RK CM VK



边框不会如下所示;



AFF

日期Session1 Session2 Session3 Session4





i想要边框t o来到以上两行。我可以帮助我。



来自我上面的代码wat更改是必需的。



when i type the above code output as follows;

AFF
Date Session1 Session2 Session3 Session4
14/1/2013 cm rk vk
15//2013 MK Rj GS
16/1/2013 RK CM VK.


from the output the border is coming only for as follows;


14/1/2013 cm rk vk
15//2013 MK Rj GS
16/1/2013 RK CM VK

Border is not coming for as follows;

AFF
Date Session1 Session2 Session3 Session4


i want the border to come for the above two lines.how can i do,help me.

from my above code wat changes are required.

推荐答案

您好,



查看以下链接:



如何在多个单元格周围设置边框擅长C#

多个使用c#在一个单元格中的格式

从C#行为错误设置Excel中的单元格样式



谢谢
Hi,

Check the following links:

How to set a border around multiple cells in excel with C#
Multiple Formats in one cell using c#
Setting cell styles in Excel from C# misbehaving

Thanks


这篇关于在excel中,多个细胞如何处于边界样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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