View Single Post
 
Old 03-20-2012, 11:32 AM
Jamal NUMAN Jamal NUMAN is offline Windows 7 64bit Office 2010 64bit
Expert
 
Join Date: Nov 2010
Posts: 615
Jamal NUMAN is on a distinguished road
Thumbs up

Quote:
Originally Posted by Catalin.B View Post
You can place a page break when the cell value in column 1 changes.
Code:
Option Explicit
Sub MakePageBreaks()
Dim i As Integer
ActiveSheet.ResetAllPageBreaks
Application.ScreenUpdating = False

For i = 2 To 800
If ActiveSheet.Cells(i, 1).Text <> ActiveSheet.Cells(i + 1, 1).Text Then
ActiveSheet.Cells(i + 1, 1).Select
ActiveWindow.SelectedSheets.HPageBreaks.Add before:=ActiveCell
End If
Next
Application.ScreenUpdating = True
End Sub
Perfect… this is what I’m looking for exactly. Many thanks Catalin.B. your time and efforts are highly appreciated.
Best
Jamal
Attached Images
File Type: jpg Clip_620.jpg (138.5 KB, 14 views)
Reply With Quote