|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
汇总表的边框:- Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
- If Sh.Name = "填单" And Target.Address = "$B$1" And Target.Value <> "" Then
- Dim brr(1 To 1, 1 To 3)
- Application.EnableEvents = False
- Worksheets("填单").Copy after:=Worksheets("填单")
- With ActiveSheet
- .Name = [b1].Value
- brr(1, 1) = .[b1]: brr(1, 2) = .[j1]: brr(1, 3) = .[j2]
- End With
- With Worksheets("汇总")
- .Activate
- X = .Cells(Rows.Count, "c").End(3).Row
- .Rows(X).Clear
- With .Cells(X, "c")
- .Resize(, 3) = brr
- .Offset(1) = "汇总"
- .Offset(1, 1) = Application.Sum(Range("d3:d" & X))
- .Offset(1, 2) = Application.Sum(Range("e3:e" & X))
- End With
- End With
- End If
- X = Worksheets("汇总").Cells(Rows.Count, "c").End(3).Row
- With Worksheets("汇总").Range("A3:F" & X).Borders
- .LineStyle = xlNone
- .ColorIndex = 0
- .TintAndShade = 0
- .Weight = xlThin
- End With
- Application.EnableEvents = True
- End Sub
复制代码 |
|