怎样在vb中设置execl表格的边框线?

zl413 2002-03-28 09:36:34
例如,将表格设置成只有横线没有竖线?
...全文
127 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
jafi 2002-03-28
  • 打赏
  • 举报
回复
要是再有问题,录制一个宏,看看不就得喽
zephyr_zhao 2002-03-28
  • 打赏
  • 举报
回复
给分哦
zephyr_zhao 2002-03-28
  • 打赏
  • 举报
回复
以a1;c3区域为例

Range("A1:C3").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
Selection.Borders(xlEdgeBottom).LineStyle = xlNone‘不画下面横线
Selection.Borders(xlEdgeRight).LineStyle = xlNone ’不画右面竖线
Selection.Borders(xlInsideVertical).LineStyle = xlNone ‘不画内部竖线
Selection.Borders(xlInsideHorizontal).LineStyle = xlNone ’不换内部横线
End Sub

应该能理解把

7,763

社区成员

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

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