Print Macro

howard

Well-known Member
Joined
Jun 26, 2006
Messages
5,636
Office Version
  1. 2019
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
 

Some videos you may like

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney

Watch MrExcel Video

Forum statistics

Threads
1,109,383
Messages
5,528,385
Members
409,817
Latest member
JiNXX9500

This Week's Hot Topics

  • Change military grades into rank
    Afternoon all Need help with formula that will change military rank (i.e. 1, 2, 3 into Amn, A1C, SrA). Running IF formula that does not work...
  • VBA COUNTIF SOLUTION
    Hi The following are the errors spread across the several columns from E to Q ie. 13 columns across several sheets with more than 500 rows per...
  • INSERT ROW WITH SPECIFIS TEXT IN A COLUMN
    Hi All! How can identify that that the row to be inserted has to be inserted before 1st row with specific text in column F. If I record the...
  • Auto-Create a monthly Sign in sheet for preschool students
    The image below is what each page looks like. Above is space for the "Child Name" "Month" "Class" School days are obviously Monday-Friday but...
  • VBA vlookup multiple results
    Hi folks, Hopefully someone out there can help. I have a list to vlookup which works (ish). the lookup only picks up the first instance of the...
  • Extract values for earliest/latest times
    I am trying to put together a formula to get the earliest start time, the latest end time from column A for each person in Column B-F without the...
Top