Print Macro

howard

Well-known Member
Joined
Jun 26, 2006
Messages
6,115
Office Version
  1. 2021
Platform
  1. Windows
I have the following print Macro. The macro works fine, except the I want the Title row headings to Change

I want this title row below to appear in the first section up to row 20


Statement of Comprehensive Income for Br1 as at 31 August 2014 YTD % of Total Income Average Per Month

I want this title row below to appear from row 22 onwards

Detail Amount % of Total Expense Avg Per Month


Code:
 Sub Print_Income_Statement()
 Sheets("Income Statement").Select

Dim LastRow As Long
LastRow = Sheets("Income Statement").Cells(Rows.Count, "A").End(xlUp).Row
Sheets("Income Statement").Select
 Application.PrintCommunication = False
With ActiveSheet.PageSetup
.PrintGridlines = True
.PrintArea = "A2:E" & LastRow
.PrintTitleRows = "$1:$1"
.PrintTitleColumns = ""
.LeftHeader = "&D&T"
.CenterHeader = Format(Range("A1"), "mmm yyyy")

 .Orientation = xlLandscape

End With
Application.PrintCommunication = True
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True


End Sub
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,118
Messages
5,835,492
Members
430,359
Latest member
ManuelCukRia

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top