Josh
May answer to Stuart.
-----------------
As an example, this colors column A between each pagebreak. It uses a
random color, so there is the possibility of having the same color twice in
succession.
Sub Tester1aa()
Dim HPBCell() As Range
Dim Cell As Range
Dim AR As Range
Dim HPBreak As HPageBreak
Dim icolor As Integer
Dim i As Long
ReDim HPBCell(1 To 2)
Set HPBCell(1) = Range("A1")
If ActiveSheet.HPageBreaks.Count > 0 Then
For i = 1 To ActiveSheet.HPageBreaks.Count
Set HPBreak = ActiveSheet.HPageBreaks(i)
If HPBreak.Type = xlPageBreakAutomatic Then
Set HPBCell(UBound(HPBCell, 1)) = HPBreak.Location
ReDim Preserve HPBCell(1 To UBound(HPBCell, 1) + 1)
End If
Next
End If
Set HPBCell(UBound(HPBCell)) = _
Cells(Rows.Count, 1).End(xlUp)(2)
Randomize
i = 0
If UBound(HPBCell, 1) > 2 Then
For i = 1 To UBound(HPBCell, 1) - 1
icolor = Int(Rnd() * 56 + 1)
For Each Cell In Range(HPBCell(i), HPBCell(i + 1).Offset(-1, 0))
Cell.Interior.ColorIndex = icolor
Next
Next
End If
End Sub
----------< end of post>----
Regards,
Tom Ogilvy
Josh <Jha...@hotmail.com> wrote in message
news:9b9301c25842$dac9a890$9de62ecf@tkmsftngxs01...