非常着急的问题,EXCEL里面显示网格。 现在我已经将数据写到了EXCEL里面,我想最后在这个数据区域内显示网格。这个代码怎么写? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 这是在宏里编写的,没用delphi写过,估计也差不多,你作为参考吧! Range("A1:E6").Select '选择需要加网格的区域 Selection.Borders(xlDiagonalDown).LineStyle = xlNone Selection.Borders(xlDiagonalUp).LineStyle = xlNone With Selection.Borders(xlEdgeLeft) '设置左边框 .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = xlAutomatic End With With Selection.Borders(xlEdgeTop) '设置顶边框 .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = xlAutomatic End With With Selection.Borders(xlEdgeBottom) '设置底边框 .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = xlAutomatic End With With Selection.Borders(xlEdgeRight) '设置右边框 .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = xlAutomatic End With With Selection.Borders(xlInsideVertical) '设置内部框 .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = xlAutomatic End With With Selection.Borders(xlInsideHorizontal) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = xlAutomatic End With 给一段代码看看,Weight 是粗细,Borders是那边。 s_Range := ExcelApp.range[ExcelApp.Cells[18, 1], ExcelApp.Cells[18, 10]]; //1-左 2-右 3-顶 4-底 5-斜( \ ) 6-斜( / ) s_range.Borders[1].Weight := 2; ExcelApp.Cells[18, 10].Borders[2].Weight := 3; s_range.Borders[3].Weight := 3; s_range.Borders[4].Weight := 2; 请问EnumChildWindows怎么转换为Tbutton to liangpei2008 dephi自定义函数可以有2个返回值吗 怎么获得pagecontrol的pages的编辑页?在设计模式里。。。。 Office助手~~~~~~~~~~ 菜单 在query中的问题。 关于TStrings和string的问题! 如何编程实现改变桌面快捷方式的位置! 如何在DELPHI内使窗体没有标题条? 求fortran计算水和水蒸气热力性质程序代码 如果根据给定的类名(注意是字串)动态创建一个对象?成功一定给分 如何让Form透明而只显示Form上已加载的不规则Gif图片呢?
Range("A1:E6").Select '选择需要加网格的区域
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft) '设置左边框
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop) '设置顶边框
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom) '设置底边框
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight) '设置右边框
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlInsideVertical) '设置内部框
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
s_Range := ExcelApp.range[ExcelApp.Cells[18, 1], ExcelApp.Cells[18, 10]];
//1-左 2-右 3-顶 4-底 5-斜( \ ) 6-斜( / )
s_range.Borders[1].Weight := 2;
ExcelApp.Cells[18, 10].Borders[2].Weight := 3;
s_range.Borders[3].Weight := 3;
s_range.Borders[4].Weight := 2;