如何利用BCB把Excel某个范围用边框框起来?如何设置某个单元的格式为文本方式?

fangrk 2003-06-27 10:07:01
Excel某个范围用边框框起来,比如用细线的口字形或者细线的田字形框起来,要用CB操纵。

我搜索了一下关于"设置某个单元的格式为文本方式",解答都是前面加"'",这样写到Excel后看上去和文本方式一样。但是,这样的话就无法利用sum等函数了
...全文
131 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
fangrk 2003-08-08
  • 打赏
  • 举报
回复
Variant Range=Sheet.OlePropertyGet("Range","B2:C2");
Range.OlePropertyGet("Borders",1).OlePropertySet("LineStyle",1);
Range.OlePropertyGet("Borders",2).OlePropertySet("LineStyle",1);
Range.OlePropertyGet("Borders",3).OlePropertySet("LineStyle",1);
Range.OlePropertyGet("Borders",4).OlePropertySet("LineStyle",1);
fangrk 2003-07-28
  • 打赏
  • 举报
回复
好像还是不行哦
suncsea 2003-07-27
  • 打赏
  • 举报
回复
利用Excel的VBA转换成BCB程序即可:下面是一段相应代码:

1。设置为田字形:所有边框

vRange=sh1.OlePropertyGet("Range","A1:E4").
vRange.OlePropertyGet("Boders").OlePropertySet("Linsty",xlContinuous);

2.上,下,左,右边框 :
vRange.OlePropertyGet("Boders",xlEdgeTop).OlePropertySet("Linsty",xlContinuous);
vRange.OlePropertyGet("Boders",xlEdgeBottom).OlePropertySet("Linsty",xlContinuous);
vRange.OlePropertyGet("Boders",xlEdgeLeft).OlePropertySet("Linsty",xlContinuous);
vRange.OlePropertyGet("Boders",xlEdgeRight).OlePropertySet("Linsty",xlContinuous);


其它的你就可以对照VBA中的参数去更换参数了。如线条的类型等。




码定乾坤 2003-07-25
  • 打赏
  • 举报
回复
学习
fangrk 2003-07-25
  • 打赏
  • 举报
回复
up
fangrk 2003-07-25
  • 打赏
  • 举报
回复
up
BCBChina 2003-07-01
  • 打赏
  • 举报
回复
不会
fscyber 2003-07-01
  • 打赏
  • 举报
回复
执行下列指令
Range("B2:B4").Select //B2,B4是选定的单元格的行列值
Selection.NumberFormatLocal = "@"
loking 2003-06-27
  • 打赏
  • 举报
回复
不会,学习

13,826

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder相关内容讨论区
社区管理员
  • 基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧