Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Insert row after a page break

Hi,

I have created a subtotal with page breaks.
I insert a row after the subtotal to insert some headers.
The problem is that the new row always before the page break appears.

Can anyone help me for this ?

Thanks a lot in advance

Benjamin

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Insert row after a page break


OK. Lets say you've inserted your subtotals and then manually inserted a
row below each of these subtotals.

You now have a series of blank rows where you want to insert your new
header.

So... Highlight the active cells in column A (assuming column A is the
column you performed your subtotals on) then try this. It should insert
a page break above each blank row.

Sub PB()
'
'Inserts page break BEFORE each blank row
'
For Each cell In Selection
If cell = "" Then
ActiveSheet.HPageBreaks.Add cell
End If
Next cell
End Sub

Hope it works!

Lee

Benlejedi wrote:
*Hi,

I have created a subtotal with page breaks.
I insert a row after the subtotal to insert some headers.
The problem is that the new row always before the page break
appears.

Can anyone help me for this ?

Thanks a lot in advance

Benjamin *




--
roundabout
------------------------------------------------------------------------
Posted via http://www.mcse.ms
------------------------------------------------------------------------
View this thread: http://www.mcse.ms/message2512130.html



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
insert page break ruben via OfficeKB.com Excel Programming 3 May 11th 06 11:57 AM
cannot insert page break tsmanz Excel Discussion (Misc queries) 2 December 5th 05 05:45 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 01:51 AM.

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

About Us

"It's about Microsoft Excel"