Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Insert Page Break in the Worksheet

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Insert Page Break in the Worksheet

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


"Thang" wrote in message
...
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Insert Page Break in the Worksheet

Thank you very very much, it works very good.

Regards,

Thang
-----Original Message-----
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


"Thang" wrote in

message
...
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



.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert Page Break da Excel Discussion (Misc queries) 2 May 11th 09 07:05 PM
INSERT ROW AND PAGE BREAK jcontrer Excel Discussion (Misc queries) 0 May 15th 08 07:09 PM
cannot insert page break tsmanz Excel Discussion (Misc queries) 2 December 5th 05 05:45 PM
Insert Page Break Question Don Excel Discussion (Misc queries) 1 June 10th 05 02:05 PM
Insert Page Break Don Excel Discussion (Misc queries) 3 June 9th 05 08:32 PM


All times are GMT +1. The time now is 03:10 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"