Insert Page Break in the Worksheet

  • Thread starter Thread starter Thang
  • Start date Start date
T

Thang

Hello,

I have a list with the column A contains Manager's name
(250 managers, each manager can take ~30 rows), how can I
insert page in the worksheet every time there is change in
the Manager's name.

Many thanks,

Thang
 
Thang,

Try something like the following code:

Dim OldVal As String
Dim Rng As Range
OldVal = Range("A1")
For Each Rng In Range("A1:A300") '<< change range
If Rng.Text <> OldVal Then
Rng.PageBreak = xlPageBreakManual
OldVal = Rng.Text
End If
Next Rng



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top