I have a workbook with multiple sheets.
The first sheet is a summary, and the following sheets are used for adding new data.
I have a macro to convert one data sheet and the summary sheet to a pdf.
I would like the data sheet to be first, and the summary to follow, but I can't seem to get this to work.
Here's the code:
</code>
Thanks!
The first sheet is a summary, and the following sheets are used for adding new data.
I have a macro to convert one data sheet and the summary sheet to a pdf.
I would like the data sheet to be first, and the summary to follow, but I can't seem to get this to work.
Here's the code:
Code:
<code>Sub PrintCurrentSheetSummary()
Dim Current As String
Dim SheetIn As Integer
Dim SheetName As String
Dim NewFilename As String
Dim Path As String
Dim Filepath As String
NewFilename = "CO " & Cells(3, 1).Value & " MBE-WBE Worksheet and Summary" ' the creates the new pdf file name
Path = Cells(1, 14).Value ' the path is dependent on where the excel file is saved
Filepath = Path + NewFilename + ".pdf"
SheetIn = ActiveSheet.Index
SheetName = Sheets(SheetIn).Name
Sheets(Array(SheetName, "Sheet1")).Select
'Sheets("Sheet1").Move after:=Sheets(SheetIn)
' this saves the pdf
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
Filepath, Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _
True
'Sheets("Sheet1").Move before:=Sheets("MBE WBE SBE")
End Sub
Thanks!