In the Project pane doubleclick VBAProject FinancialStatementsxls

3. From the Insert menu, select Module.

4. Select the module, and press <F4>. The Properties dialog box appears.

5. In the Name row, change the module's name to Printing.

6. Type the code below into the module sheet:

Sub PrinL_Finaneia l._5 tat eme nts()

Dim NumberPages As Integer, I As Integer

Dim VieTjName As String

Application. ScreenUpdating = False NumfcierPages = ActiveWorkbook. CustomVieTjs . Count foe I = 1 To NumberPages

Vi.eTjName = Acti.veTJorkbook. CustomVieTjs (I) .Name ActiveTdorktaook. CustomVieTjs (VieTjNaine) .Show With Act i.veSheet. PageSetup .CenterFooter = I

.LeitFooter = ActiveWorkbook. FullName £ "£A £T £D" End Hitli

Act iveSheet. Pr i.ntOut Next I

App 1icati.on. ScreenUpdating = True End Sub


The macro VBA code lines can be copied from

0 0

Post a comment