1、打开VBA编辑器或按住Alt+F11
2、插入模块(右击插入或菜单栏插入)
3、右边代码编辑处输入VBA代码
4、VBA代码Sub ConvertPDF() strPath = ThisWor氯短赤亻kbook.Path & "\"'定义当前工作簿路径For Each s In Sheets'遍历该路径下所有工作簿If s.Name <> "当前excel名字" Then'同路径下非当前工作簿s.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _strPath & s.Name & ".pdf", Quality:=xlQualityStandard, _IncludeDocProperties:=True, IgnorePrintAreas:=False,_OpenAfterPublish:=FalseEnd IfNextEnd Sub