|
- Sub Macro1()
- Application.ScreenUpdating = False
- Application.DisplayAlerts = False
- Set sh = Sheets("报告模板")
- sh.Select
- r = Sheets("数据源").Cells(Rows.Count, 3).End(3).Row
- arr = Sheets("数据源").Range("c4:c" & r - 3)
- pth = ThisWorkbook.Path & ""
- For j = 1 To UBound(arr)
- sh.Select
- If Len(arr(j, 1)) > 0 Then
- sh.[d3] = arr(j, 1)
-
- nm = sh.[b3] & sh.[d3] & sh.[e3] & ".pdf"
- ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
- pth & nm, Quality:= _
- xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, _
- OpenAfterPublish:=False
- End If
- Next j
- Application.DisplayAlerts = True
- Application.ScreenUpdating = True
-
- End Sub
复制代码 |
|