Avatar of Pearlyn Tan
Pearlyn Tan

asked on 

Print Title Row with Variable

Hi I'm looking to print the title row that contains a certain text on each page.

The title row is not always on a fixed row on the sheet (some sheets might have more rows above the title than other sheets), but the title row is always fixed with "Product Information" in column B

With ActiveWorkbook.Sheets("Filtered List")
     LR = .Range("B" & Rows.count).End(xlUp).Row
Set FindRow = .Range("B:B").Find(What:="Product Information", LookIn:=xlValues)

findrownumber = FindRow.Row
     Application.PrintCommunication = False
    With Sheets("Filtered List").PageSetup
        .PrintArea = "A1:G" & LR
        .FitToPagesWide = 1
        .FitToPagesTall = False
        .PrintTitleRows = findrownumber

Open in new window

This doesn't work and I get an error on the printTitleRows line, hope you can help!
VBAMicrosoft ExcelMicrosoft Office

Avatar of undefined
Last Comment
Pearlyn Tan

8/22/2022 - Mon