I'm trying to create a loop that will pdf selected sheets that are between sheets "Start" and "End". For some reason it will pdf the first tab but then it stops. Here is my current code:
Sub PDF_Converter()
Dim ws As Worksheet, aws As Worksheet
Dim StartIndex, EndIndex As Integer
Dim i As Integer
Set aws = ActiveSheet
MName = ActiveSheet.Name & ".pdf"
MDir = "U:\Dashboard\Jaime Bailey"
StartIndex = Sheets("Start").Index + 1
EndIndex = Sheets("End").Index - 1
Application.ScreenUpdating = False
Sheets("Start").Next.Select
For i = StartIndex To EndIndex
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=MDir & "\" & MName, Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False
Next i
End Sub
Bookmarks