» Creating a Custom Report Manager
CATEGORY - Excel Printing
VERSION - All Microsoft Excel Versions
Structure of the Custom Print Report:
2. Column A: This column contains numbers between 1 and 3: print from sheet, print by range name, or print from Custom View (recommended).
3. Column B: Type the sheet name, range Name, or Custom View name.
4. Column C: Type the page number to be printed in the footer.
The macro will print from a sheet and automatically add the necessary information to the footer, including page number, workbook name, path address, and sheet name, as well as the date and time of printing.
Sub PrintReports()
Dim NumberPages As Integer, PageNumber As Integer, i As Integer
Dim ActiveSh As Worksheet, ChooseShNameView As String
Dim ShNameView As String, cell As Range
Application.ScreenUpdating = False
Set ActiveSh = ActiveSheet
Range("a2").Select
For Each cell In Range(Range("a2"), Range("a2").End(xlDown))
Select Case cell.Value
Case 1
Sheets(ShNameView).Select
Case 2
Application.GoTo Reference:=ShNameView
Case 3
ActiveWorkbook.CustomViews(ShNameView).Show
End Select
With ActiveSheet.PageSetup
. CenterFooter.PageNumber
.LeftFooter = ActiveWorkbook.FullName & " " & "&A &T &D"
End With
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Next i
ActiveSh.Select
Application.ScreenUpdating = True
End Sub
5. The For Each loop in the macro causes a separate print for each cell in column A starting at A2.
6. In the loop, the print area is selected using the Select Case technique.
7. The information printed on the left side of the footer: &08 = 8 point font, &D = Date, &T = Time.
8. To run the macro from the sheet, press Alt+F8, select the macro and click Run.
OR
Add a button to the sheet and attach the macro to it.
9. Note: Use this technique to add an unlimited number of reports.

Book Store:
Recommended Books:
- The Essential 55: An Award-Winning Educator's Rules for Discovering the Successful Student in Every Child
- Microsoft Access Version 2002 Step by Step
- The New Financial Order: Risk in the Twenty-First Century
- The Total Money Makeover. : A Proven Plan for Financial Fitness
- Microsoft Excel VBA Programming for the Absolute Beginner
- Positioning: The Battle for Your Mind
No comments have been submitted.

