|
按照sheet名称确定部门,汇总各sheet合计这一行的销售额、销售奖励及合计数
- Sub t()
- Dim i As Integer
- Range("A2:E65536").ClearContents
- For i = 1 To Sheets.Count
- If Sheets(i).Name <> "汇总" Then
- With Sheets(i)
- Cells(65536, 2).End(xlUp).Offset(1) = Left(Sheets(i).Name, Len(Sheets(i).Name) - 2)
- Cells(65536, 3).End(xlUp).Offset(1) = .Cells(65536, 5).End(xlUp)
- Cells(65536, 4).End(xlUp).Offset(1) = .Cells(65536, 6).End(xlUp)
- Cells(65536, 5).End(xlUp).Offset(1) = .Cells(65536, 7).End(xlUp)
- End With
- End If
- Next
- End Sub
复制代码
|
|