如上图中,在A行插入月份,B列插入规律的值,1 -12月份,各月份之间空一行。
Sub cs1()
Dim i As Integer '12个月
Dim n As Integer '6
Dim y As Integer '月份
Dim yf As String
Dim x As Integer
y = 2
x = 2
arr = Array("养老", "医疗", "工伤", "生育", "失业")
For i = 1 To 12
Cells(x, 2).Resize(5, 1) = Application.WorksheetFunction.Transpose(arr)
For n = 1 To 6
If n < 6 Then
yf = CStr(i) + "月"
Cells(y, 1) = yf
y = y + 1
Else
y = y + 1
x = y
End If
Next n
Next i
End Sub