|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
- Sub 分类汇总表内虚外实() '没有修改好
- Dim i As Integer, lastrow As Integer '声明两个长整型变量
- Application.ScreenUpdating = False
- With Sheets("分类汇总")
- lastrow = .Cells(Rows.Count, 3).End(xlUp).Row
-
- If lastrow = 3 Then .Borders.LineStyle = xlNone: Exit Sub
- For i = 4 To lastrow
- If .Cells(i, 2) <> "" Then
- With Range("B" & i & ":AA" & lastrow)
-
- .Borders.Weight = xlThin
- .Borders(xlEdgeLeft).LineStyle = xlContinuous '左
- .Borders(xlEdgeRight).LineStyle = xlContinuous '右
- .Borders(xlEdgeTop).LineStyle = xlContinuous '上
- .Borders(xlEdgeBottom).LineStyle = xlContinuous '下
- .Borders(xlInsideHorizontal).LineStyle = xlContinuous '内横线
- .Borders(xlInsideHorizontal).Weight = xlHairline '最细线
- .Borders(xlInsideVertical).LineStyle = xlContinuous '内竖线
- .Borders(xlInsideVertical).Weight = xlHairline
-
- End With
- End If
- Next
- End With
- Application.ScreenUpdating = True
- End Sub
复制代码 请老师帮忙改下代码,代码找于论坛老师修改,但还是没有达到效果,我想B列单元格为空就不要画线。像我效果图那样
谢谢老师帮忙。
|
|