I have a macro that saves multiple sheets to a pdf file. I'm trying to edit it to just save one sheet (Dash) as pdf. I keep getting a debug on one of two lines
Sheets(Array("Dash")).Select
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=savePATH & saveName, _
Quality:=xlQualityStandard, IncludeDocProperties:=True, _
IgnorePrintAreas:=False, OpenAfterPublish:=False
The Sheets(Array line used to have 5 sheets named - I just removed 4 names. If you could help me to understand what needs to be changed I'd be appreciative. An explanation of why it needs to change would help me grow in my understanding of this macro.
Full Macro
Sub Save_As_PDF()
Application.ScreenUpdating = False
Sheets("Pivot1").Select
Columns("B:B").Select
Selection.NumberFormat = "# ?/?"
Range("B1").Select
Sheets("Dash").Select
Range("C7").Select
Dim savePATH As String, saveName As String
Application.ScreenUpdating = False
savePATH = "C:\Users\Jim\Documents\!LGTC\!!!!Humana MMP\New folder\" & Format(Date, "MM-DD-YYYY") & "\"
saveName = Sheets("Dash").Range("E4").Text & ".pdf"
saveName = removeSpecial(saveName)
On Error Resume Next
MkDir savePATH
On Error GoTo 0
Sheets(Array("Dash")).Select
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=savePATH & saveName, _
Quality:=xlQualityStandard, IncludeDocProperties:=True, _
IgnorePrintAreas:=False, OpenAfterPublish:=False
Sheets("Dash").Activate
Application.ScreenUpdating = True
End Sub
Bookmarks