I found a macro that prints an excel worksheet to PDF, I want to be able to do this across multiple worksheets without having to use the worksheet name but with the worksheet index. I'd like to have the pdf saved based on a range in each worksheet (this range is the same on all sheets).
heres what i have:
Sub exceltoPDF1()
'Saves the excel print area to a PDF file
Dim fp As String
Dim wb As Workbook
Dim ws As Worksheet
Dim rng As Range
Worksheets(1).Activate
Set rng = Worksheets(1).Range("A1")
'\\MNACPFS01\Home\sramdeo\Desktop\stuff
i = rng
fp = "\\MNACPFS01\Home\sramdeo\Desktop\stuff "
'fp = "H:\2013_FY148\07_OCT13\4. PROGRAM DOCS\APR\ " & "rng.pdf"""
Set wb = ActiveWorkbook
Set ws = Worksheets(1)
ws.ExportAsFixedFormat Type:=xlTypePDF, Filename:=i, Quality:=xlQualityStandard, IncludeDocProperties:=False, IgnorePrintAreas:=False, OpenAfterPublish:=True
End Sub