- 帖子
- 216
- 主題
- 71
- 精華
- 0
- 積分
- 292
- 點名
- 0
- 作業系統
- window xp
- 軟體版本
- 2007
- 閱讀權限
- 20
- 性別
- 女
- 註冊時間
- 2012-6-27
- 最後登錄
- 2024-9-28
|
各位,有新問題, 因想另設一個輸入的選擇, 已定如下, 如有兩個問題未做到:
(1) 以SHOP2 輸入A, 另F輸入"201507", 想PDF FILE會轉為"A 201507".PFD但出現錯誤
(2) 在轉PDF後, 如何返回EXCEL, 因為要將每個PDF逐個關閉.
Sub in_box2()
'
Dim shop2 As String
Dim f As String
'
shop2 = InputBox("Enter your shop code")
f = InputBox("Enter month of the report")
Range("B4").AutoFilter Field:=4, Criteria1:=shop2
Range("B4").CurrentRegion.Select
ChDir "C:\Users\Desktop\"
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, filename:= _
"C:\Users\Desktop\" & f & "2015.pdf"), Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, OpenAfterPublish:=True
'
End Sub |
|