kelly mort
Well-known Member
- Joined
- Apr 10, 2017
- Messages
- 2,169
- Office Version
- 2016
- Platform
- Windows
Hello,
Is it possible to repeat certain range of data on each sheet as with the headers in
???
The code below is just an example.
I have a code similar to the one below here which I use to set my page breaks.
Sometimes, the columns grow so that avoiding multiple vertical page breaks cause readability issues.
I think when I am able to get the first 3 columns repeated, it would help me to easily reference items.
But since different rows of data will appear on a sheet of there are multiple horizontal breaks, I don't know how to go about it.
I will be glad if someone can show me the way.
Thanks in advance.
Is it possible to repeat certain range of data on each sheet as with the headers in
Code:
.PageSetup.PrintTitleRows = "$1:$2"
The code below is just an example.
I have a code similar to the one below here which I use to set my page breaks.
Sometimes, the columns grow so that avoiding multiple vertical page breaks cause readability issues.
I think when I am able to get the first 3 columns repeated, it would help me to easily reference items.
But since different rows of data will appear on a sheet of there are multiple horizontal breaks, I don't know how to go about it.
I will be glad if someone can show me the way.
Thanks in advance.
Code:
Sub HPage_Breaks()
Dim rpp As Long, rh As Long, i As Long, lr As Long, lc As Long
lr = Sheet2.Cells.Find("*", , , , xlByRows, xlPrevious).Row
lc = Sheet2.Cells.Find("*", , , , xlByColumns, xlPrevious).Column
With Sheet2
.ResetAllPageBreaks
.PageSetup.Zoom = 50
.PageSetup.PrintArea = .Range("A2:O" & lr).Address
.PageSetup.PrintTitleRows = "$1:$2"
.HPageBreaks.Add (.Cells(52, 1))
For i = 1 To lr / (51)
.HPageBreaks.Add (.Cells(.HPageBreaks(i).Location.Row + 51, 1))
Next i
End With
Sheet2.PrintOut
End Sub