【发布时间】:2014-10-11 01:12:55
【问题描述】:
如果我打印为 PDF,我不喜欢我的 pdf 质量。但是当我保存为 PDF 时,它会更清晰。所以我尝试了这段 VBA,但我一直在 ElseIf 语句上收到错误。它到底有什么问题?
If Range("AE2").Value = 1 Then ActiveSheet.Range("A1:M55").ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
ActiveWorkbook.Path & Application.PathSeparator & "\" & Range("A23").Value & "\" & Range("AC6").Value & "\" & Range("AD6").Value & "\" & Range("AC3").Value & ".pdf", Quality:=xlQualityStandard, IncludeDocProperties:=True, _
IgnorePrintAreas:=False, OpenAfterPublish:=False
ElseIf Range("AE2").Value = 2 Then ActiveSheet.Range("A1:M108").ExportAsFixedFormat Type:=xlTypePDF, Filename:=
ActiveWorkbook.Path & Application.PathSeparator & "\" & Range("A23").Value & "\" & Range("AC6").Value & "\" & Range("AD6").Value & "\" & Range("AC3").Value & ".pdf", Quality:=xlQualityStandard, IncludeDocProperties:=True, _
IgnorePrintAreas:=False, OpenAfterPublish:=False
ElseIf Range("AE2").Value = 3 Then ActiveSheet.Range("A1:M162").ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
ActiveWorkbook.Path & Application.PathSeparator & "\" & Range("A23").Value & "\" & Range("AC6").Value & "\" & Range("AD6").Value & "\" & Range("AC3").Value & ".pdf", Quality:=xlQualityStandard, IncludeDocProperties:=True, _
IgnorePrintAreas:=False, OpenAfterPublish:=False
End If
感谢您的调查
【问题讨论】:
标签: excel if-statement vba