|
Sub Gather_Click()
Dim i As Integer, m As Integer, sht As Worksheet
Set ts = ThisWorkbook.Sheets(ActiveSheet.Name)
' 创建企业缴纳导入文件
With Workbooks.Add
.Sheets(1).Range("A1:D1") = Array("*费用要素", "*用工类型", "*金额", "备注")
.Sheets(1).Range("A2:A6") = Array("应付职工薪酬-社会保险费-基本养老保险费", _
"应付职工薪酬-社会保险费-失业保险费", _
"应付职工薪酬-社会保险费-基本医疗保险费", _
"应付职工薪酬-社会保险费-工伤保险费", _
"应付职工薪酬-住房公积金")
.Sheets(1).Range("B2:B6").Value = "在岗员工"
.Sheets(1).Cells(2, "C") = ts.Cells(13, 25) '养老
.Sheets(1).Cells(3, "C") = ts.Cells(14, 25) '失业
.Sheets(1).Cells(4, "C") = ts.Cells(15, 25) + ts.Cells(16, 25) + ts.Cells(17, 25) '医疗
.Sheets(1).Cells(5, "C") = ts.Cells(18, 25) '工伤
.Sheets(1).Cells(6, "C") = ts.Cells(21, 25) '公积金
.SaveAs Filename:=ThisWorkbook.Path & "\" & ts.Cells(2, 3) & "-缴纳明细-企业部分.xlsx"
.Close SaveChanges:=True
End With
End Sub
运行之后,并没有写入相关数据
请问是怎么回事
|
|