|
我也来一个哈哈
Private Sub Worksheet_Activate()
Dim i, j, X As Integer
Cells.Delete Shift:=xlUp
Columns("A:A").ColumnWidth = 9.25
X = 2
For j = 5 To Sheet3.Rows.Count
If (Sheet3.Cells(j, 1).Value <> "") Then
For i = 1 To 18
Cells(X - 1, 1).Value = "日 期"
Cells(X, 1).Value = Format(Sheet3.Cells(3, 8), "yyyy年mm月")
Cells(X - 1, i + 1).Value = Sheet3.Cells(4, i)
Cells(X, i + 1).Value = Sheet3.Cells(j, i)
Cells(X + 1, i).Value = "- - - - - "
Cells(X + 1, i + 1).Value = "- - - - - "
With Range(Cells(X - 1, "a"), Cells(X, "s")).Borders
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 14
End With
Next i
X = X + 3
Else
GoTo ENDSUB
End If
Next j
ENDSUB:
MsgBox "工资条生成完毕!", 64, "系统提示"
End Sub |
|