|
Sub 工资条()
Application.ScreenUpdating = False
Dim ar As Variant
Application.DisplayAlerts = False
For Each sh In Sheets
If sh.Index > 2 Then
sh.Delete
End If
Next sh
Application.DisplayAlerts = True
With Sheets("汇总表")
r = .Cells(Rows.Count, 1).End(xlUp).Row
y = .Cells(1, Columns.Count).End(xlToLeft).Column
If r < 3 Then MsgBox "汇总表为空!": End
ar = .Range("a2:bj" & r)
End With
For i = 2 To UBound(ar)
If Trim(ar(i, 2)) <> "" Then
Sheets("样表").Copy after:=Sheets(Sheets.Count)
With ActiveSheet
.[c3] = ar(i, 2)
.Name = ar(i, 1) & "_" & ar(i, 2)
lh = 1: xh = 4
For j = 3 To UBound(ar, 2) Step 12
xh = xh + 1
lh = 1
For s = j To j + 11
lh = lh + 1
.Cells(xh, lh) = ar(i, s)
Next s
Next j
End With
End If
Next i
Application.ScreenUpdating = True
MsgBox "ok!"
End Sub
|
评分
-
1
查看全部评分
-
|