Inserting Page Breaks #2

I have a worksheet that in column "S" I have written a simple equation
that checks column "R" to see if a value is repeated. When it comes to
an instance where the cell in column "R" does not repeat, it inputs
"Insert Page Break" in the affected cell in column "S".

Is there a way to automatically insert a page break at the cell that
"Insert Page Break" occurs and continue down the worksheet until it
finds the same instruction again?

You can see an example attached.

Chris Nelson


+-------------------------------------------------------------------+
|Filename: test1.txt                                                |
|Download: http://www.excelforum.com/attachment.php?postid=4108     |
+-------------------------------------------------------------------+

-- 
chrisnelsonusa1
------------------------------------------------------------------------
chrisnelsonusa1's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=29526
View this thread: http://www.excelforum.com/showthread.php?threadid=492279

0
12/9/2005 7:18:33 PM
excel.misc 78881 articles. 5 followers. Follow

3 Replies
417 Views

Similar Articles

[PageSpeed] 35

Chris

Instead of using a formula to show "insert page break" you can dispense with
column S and run a macro on Column R directly to insert a page break at each
change of value in column R,

Sub InsertBreak_At_Change()
Dim i As Long
    For i = Selection.Rows.Count To 1 Step -1
        If Selection(i).Row = 1 Then Exit Sub
        If Selection(i) <> Selection(i - 1) And Not IsEmpty _
                (Selection(i - 1)) Then
            With Selection(i)
                .PageBreak = xlPageBreakManual
            End With
        End If
    Next
End Sub


If not familiar with VBA and macros, see David McRitchie's site for more on
"getting started".

http://www.mvps.org/dmcritchie/excel/getstarted.htm

In the meantime..........

To create a General Module, hit ALT + F11 to open the Visual Basic Editor.

Hit CRTL + R to open Project Explorer.

Find your workbook/project and select it.

Right-click and Insert>Module.  Paste the above code in there.  Save the
workbook and hit ALT + Q to return to your workbook.

Run the macro by going to Tool>Macro>Macros.


Gord Dibben Excel MVP



On Fri, 9 Dec 2005 13:18:33 -0600, chrisnelsonusa1
<chrisnelsonusa1.1zserb_1134156001.6008@excelforum-nospam.com> wrote:

>
>I have a worksheet that in column "S" I have written a simple equation
>that checks column "R" to see if a value is repeated. When it comes to
>an instance where the cell in column "R" does not repeat, it inputs
>"Insert Page Break" in the affected cell in column "S".
>
>Is there a way to automatically insert a page break at the cell that
>"Insert Page Break" occurs and continue down the worksheet until it
>finds the same instruction again?
>
>You can see an example attached.
>
>Chris Nelson
>
>
>+-------------------------------------------------------------------+
>|Filename: test1.txt                                                |
>|Download: http://www.excelforum.com/attachment.php?postid=4108     |
>+-------------------------------------------------------------------+
0
Gord
12/9/2005 8:31:44 PM
I have to tell you, this web site makes me a hero every time here a
work. Thanks so much for the help and the macro, you just saved someon
at least two hours of monotony every week.

Chri

--
chrisnelsonusa
-----------------------------------------------------------------------
chrisnelsonusa1's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=2952
View this thread: http://www.excelforum.com/showthread.php?threadid=49227

0
12/9/2005 9:02:53 PM
Thanks for the feedback Chris.

That's what macros are all about.....relieving the drudgery of repetitive
tasks.


Gord

On Fri, 9 Dec 2005 15:02:53 -0600, chrisnelsonusa1
<chrisnelsonusa1.1zsjum_1134162602.947@excelforum-nospam.com> wrote:

>
>I have to tell you, this web site makes me a hero every time here at
>work. Thanks so much for the help and the macro, you just saved someone
>at least two hours of monotony every week.
>
>Chris
0
Gord
12/9/2005 9:34:45 PM
Reply:

Similar Artilces:

Can you insert a picture into a specific cell?
Or do they only "float" on the page. Marc They float over the worksheet, but you can adjust the size so that it seems to fit a cell exactly. If you insert a picture, you can hold the alt-key down while you move/resize the picture. When it gets close to the edge of a cell, it'll snap-to that edge. Marc wrote: > > Or do they only "float" on the page. > > Marc -- Dave Peterson ...

Problems with creating a newsletter
I chose the form "Newsletter - email". I have created a 3 page newsletter. Now, I have NO IDEA how to send it out as an email. I do not want to send it as an attachment. I cannot figure out which "save as" format or what I need to do so that i can email this newsletter. Is there a website that goes through how to do this? Am I correct when I say that it has to be html in order for me to send it as email? That is not one of the options. Any help you give me would be greatly appreciated. Thank you, Markis www.adreamforabetterworld.com ...

Meeting updates #2
My users cannot update meetings created when they were on the old email server. I have noticed that the old string is still mapped to the meeting. e.g x400;c=us;a= ;p=Org name;o=exchagne;s=Lastname;g=firstname; Take a look at the following article: 275134 XADM: Cannot Reply to Messages That Are Sent from a User Account That http://support.microsoft.com/?id=275134 The same thing applies to meetings. How did you move them and what version(s) of Exchange? Thanks, Richard Roddy Microsoft Exchange Support This posting is provided "AS IS" with no warranties, and confers no ri...

Changing SQL Server for CRM 1.2
As my SQL server is currently on its last breath I am in the process of moving our CRM 1.2 databases to a new dedicated serever. I have detatched the databases from the old server, copied the files to the server and attached them. I have then gone into CRM deployment manager and changed to the SQL server to the new server. That all appears to work fine, no error messages. But when users try to access the CRM system they get an error and the CRM server event log fills with error messages. A few are listed below: dmLog: Failed to execute the SQL batch in the file sqlbatch.sql. MSCRM P...

How do you turn off/on the "1" or "2" or "+" or "-" view hide/unh.
What is or how do you control, turn on/off the small "1" "2" or "+" "-" hide/unhide view buttons right above the "A" cell? Sometimes shows when I hide columns. Hi 'Data - Goup/Outline' -- Regards Frank Kabel Frankfurt, Germany Seth wrote: > What is or how do you control, turn on/off the small "1" "2" or "+" > "-" hide/unhide view buttons right above the "A" cell? Sometimes > shows when I hide columns. You can toggle them to hide or display with <Ctrl> <8> Usi...

Can't insert Char(1) into SQL Server from Stored Procedure
Hello I am trying to insert a char(1) field into a table from an ASP.Net/C# application. At first I was inserting rows into the table but none of the columns that I was inserting the rows into were char(1) columns, they were mostly int and varchar columns. Then I found out that there was one column in the list that was not supposed to be an int column but instead it was supposed to be one of the char(1) columns into the table. So I replaced the int column in the list with the char(1) column and since the value of the char(1) column resulted from a CheckBox ('Y...

Steps to Share Outlook on 2 different drives
This is a problem created by a dual boot of XPPSP2 on one drive C:\ and Vista on another drive E:\ that I use to format for new builds of Vista on the same box. I want to take my Outlook 2003 in box and folders on two different drives on one box and combine them so that all the emails go to one account and all the folders can be shared or used on each drive. I want to do the same with Outlook Express as well, and since this is an *Outlook newsgroup, I'll just take what I learn here and apply it to the ..dbx folder(s) in it. The idea is to receive email on both drives in one in one...

printing 2 charts on single page
Using Excel 2k, Win 2k I was trying to print to line charts on a single page to demonstrate the corelation between the two data sets. I would like to print in portait mode with one chart on top of page and one on bottom. Excel only seems to offer putting chart 2 on a separate page or embedding it in chart one. I am not very familiar with excel charting capabilites can anyone suggest a resorce? Thanks ...

multiple flyers per page?
Hello. I need to make a custom template with publisher. It will be one 8 1/2 by 11 paper divided horizontally into three parts so that there are three fliers that can be printed. each flier needs to be double printed so I need to make it a double sided project like a postcard or brochure layout. I can figure out text and image stuff. But I don't know how to make a basic custom project that is divided into three panels horizontally (so 8 inches by 3.83 inches roughly) Also an additional customization would divide each 3.83 by 8 inch flyer into two parts so one 8 by 11 page would ...

Offline folder problems #2
Hi Guys, Basically I installed Outlook 97 on my office PC which is connect to microsoft exchange server. For some reason all of my messages were copied into offline folders, this causes a problem, whenever I open up outlook I get this message. Upload of offline changes could not be completed you do not have sufficient permission to perform this operation on this object. See the folder contact or see your system administrator. I do not administrator access on my user profile, every time I open outlook it resets everything I have changed (view etc) and gives that error message. How ...

Receiving Transaction Entry #2
I went into Receiving Transaction Entry to record the receipt of an item. The invoiced price did not agree with the purchase order. I had to add Shipping and adjust the provincial tax. I went to the proper screen to over-ride the calculated tax and the system told me that I couldn't do that because I had not filled in all the BOLD, RED areas. At that point I wanted to close down that screen, but the system would not let me do that either. I could minimize the screen and then I could also see that there wasn't any required information that had not be entered. The only way I c...

Opening pub files created with older Publisher versions #2
I have just upgraded to Publisher 2003 from 2000 and am having trouble with pub files sent to me for our chuch newsletter which is using Publisher 97 The text is not wrapping around graphics boxes. Can I fix this? I really don't want to go back to Pub 200 Thank Richard this is caused by Publisher 97 not been printer independent. Even if you went back to Publisher 2000, unless you have the identical font versions and printer driver you would have issues with formatting. It sounds like the person sending you the file has a garbage HP inkjet printer. Get them to install the HP5P laser p...

Page setup for 8.5x11 calendar w/picture on tabloid paper?
How can I set up a calendar with 8.5x11 (landscape) pages with pictures for each month to print on tabloid (11x17) paper so it can be saddle stiched? I would like the picture on the top half and calendar on the bottom half. I keep ending up with two of the same pictures on one page and two calendars on the next page. Thanks, Bob I assume you are taking this to a professional printer so why not just set each page up as a landscape 8� x 11 and let your printer do the rest? -- JoAnn Paules MVP Microsoft [Publisher] "Bob at 4799" <Bob at 4799@discussions.microsoft.com>...

Associating Multiple Existing Contacts to an Account, Until CRM 2.x
I have racked my pea-sized brain for endless days for a way to associate multiple existing contacts (or accounts) to an account. My client has accounts that have many contacts (or accounts) involved at different stages of acquiring a new account. The logical method would be to add a custom attribute with lookup functionality into the existing CRM contact or account objects but this is not possible with CRM 1.x. The resulting UI would allow an end user to associate different contacts (or accounts) to an account. Example: Account: ABC - AccountPhysician: (existing account or con...

VCard issue #2
This is a weird problem, but when I send a vcard to someone, it shows up in my sent items as a vcf file, and has a vcard icon on it, but when the recipient gets the VCard, it shows up as msg file, with an envelope icon as the attachment. When I open it, nothing is there - it's empty. I can't find anything regarding this problem on google or MS's website. Anybody have any ideas? Is it a problem with Outlook? Do I need to do a detect and repair, a reinstallation? Thanks for your help! Does the same happen when you send a message to yourself? Is he/she able to see it w...

Some Excel formatting functions taking a long time to work #2
Excel 2000 SP3 When I use some formatting functions for the first time in a session, such as bold, increasing font size etc, it takes up to 30 seconds to work. Meantime Excel is locked up until it completes that formatting call. I suspect faulty DLL? Has anyone experienced this? How to fix (other than a complete re- install) ? Any advice appreciated. Piri On Nov 5, 8:39=A0am, Piri <wiremu.pare...@hotmail.com> wrote: > Excel 2000 SP3 > When I use some formatting functions for the first time in a > session, such as bold, increasing font size etc, it takes =A0up to 30 > secon...

Shortcut for inserting names?
Hi, I am building many formulas, each with many named cells as part of it. Currently I have to go to Insert | Name | Paste with the mouse each time I want to insert a name. I looked in Walkenbach's Excel Bible but couldn't find any mention of a keyboard shortcut or other shortcut. Is there one I could take advantage of? I've got Excel 2002. Thanks, Jamie ...

2 Domains, 1 Exchange Server
Hi, We're trying to go with 2 seperate 2003 domains, but with only one Exchange 2003 Server. What would be needed for the domain that the Exchange server is not in to access e-mail? We've contemplated having those users use OWA, but would really like them to be able to use Outlook 2003. We're a school district and want to segregate the kids domain from the administration domain, but only have funding for one Exchnage server. Any ideas\help will be appreciated. TIA. Hi, This should explain what it requires: http://support.microsoft.com/?id=278888 Leif "tj woo...

Creating a Macro to Delete Commas #2
I have an excel file that the size will varry. I need a macro that will check all the fields for a comma. If there is one I would like to get rid of it. Does anyone have any idea how to do this? I have no idea and I have been assigned this task. Help --- Message posted from http://www.ExcelForum.com/ No macro required. ctrl-H for find/replace. find , replace nothing (leave the replace field blank). You can of course record that within a macro if you wish. Drabbacs >-----Original Message----- >I have an excel file that the size will varry. I need a macro that will >check ...

how do I import my contacts from IncrediMail 2.0 to MOutlook2007
I am new to using microsoft outlook 2007 and am searching for a way to upload my contact list, from Incredimail 2.0 to Outlook 2007. Any help would be definitely appreciated, thanks! How do I save my IncrediMail Address Book and move it to a different location? http://help.incredimail.com/incredimail/help_center/help_article.aspx?is=t&article_id=67&lang_id=9 In Outlook - File --> Import and Export ... import the CSV file created via process noted above Karl -- ____________________________________________________________ Karl Timmermans - The Claxton Group Co...

Money 2004 Debt Planner #2
When trying to add a loan to the debt planner, Money keeps telling me that I am 6 months past due on this particular loan. In reality, I have made consistent entries for each month's payment. This is making it really difficult to use the debt planner! What do I need to do? ...

Indirect Method for Name Box Variable? #2
DARN The reason I want to do this is that I have to collect data on a dail basis but I have to display it on a graph on a weekly basis. I select the entire week of cells and give it a name like week52. The following week I have to select the entire week and name i week53. Everything is set up that I can just copy and the numbers will progres for whatever length of time I need to graph (months, years, etc) excep this. Maybe I'll just go back to using the range of cell numbers. Thanks guys -- Chris Brenna ----------------------------------------------------------------------- Chris Bre...

80070005 error #2
I am getting this error when trying to view public folder property from system manager. My issue is same as what you can find out from http://forums.msexchange.org/ultimatebb.cgi? ubb=get_topic;f=19;t=000114 Anyone has a clue? ...

HQ Licensing question V.2
I have a client running HQ client at 8 stores + HQ server at the warehouse. They would like to be able to use transfers from the warehouse to the stores, so I would have to setup a new PC running Store Ops and a new database, however, in order for the transfers to take place, I need a HQ Client License correct? Do I also need a POS key? I appreciate any insights you may have. Thanks in advance Hi Phil yes - you'll need an HQ Client license so it can exchange with your headquarters - "export" the wh database as you would any store from HQ no - you won't need a PO...

How do I insert space between 2 consecutive columns of an XL Shee.
I want to have space between two consecutive columns of a worksheet (of course, without having inserted another column between the two) in order to have separated the Border Lines of the adjacent cells/columns. Please guide me if it can be done in XL. Can you achieve the effect that you're looking for by using a double vertical border down the right side of the left column and having no border down the left side of the right column? Rgds, ScottO "Shamshad Butt" <Shamshad Butt@discussions.microsoft.com> wrote in message news:1222EE13-11A9-4354-9F12-D1F1155D3902@microsof...