1、打开VBA编辑器或按住Alt+F11

2、插入模块(右击插入或菜单栏插入)

3、右边代码编辑处输入VBA代码

4、VBA代码
Sub ConvertPDF() strPath = ThisWorkbook.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:=False
End If
Next
End Sub