- Sub 批量生产申请表()
- arr = Sheets("数据源").Range("A1").CurrentRegion
- For i = 2 To UBound(arr)
- Sheets("模板").Copy
- With Sheets("模板")
- r = Val(Left(arr(i, 2), 1))
- .[b2] = "大赛报名表(类别:" & arr(i, 3) & ")"
- .[c4] = arr(i, 4)
- .[e4] = arr(i, 5)
- .[g4] = arr(i, 6)
- .[c5] = arr(i, 7)
- .[e5] = "'" & Replace(arr(i, 8), "[身份证]", "")
- .[b8] = arr(i, 9)
- If r = 2 Then
- .[c6] = arr(i, 10)
- .[e6] = arr(i, 11)
- .[g6] = arr(i, 12)
- .[c7] = arr(i, 13)
- .[e7] = "'" & Replace(arr(i, 14), "[身份证]", "")
- .[b9] = arr(i, 15)
- End If
- ActiveWorkbook.SaveAs ThisWorkbook.Path & "\申请表存放" & arr(i, 1) & ".xlsx"
- ActiveWorkbook.Close
- End With
- Next i
-
- End Sub
复制代码 |