The templates can be used for both personal and business use but a reference to the PPTTemplate is requested. How to create a template in powerpoint for mac. How much hard drive space for autocad 2016 mac. Dec 30, 2011 - Go to 'Preferences' under the Excel menu, click the 'View' item, and in the 'Window options' section at top right, check the box next to 'Show page breaks' (the very first item). Click 'OK', and you should have the page breaks showing, which you can now drag if you hover the mouse over them. ![]() I am trying to insert page breaks in a worksheet in Excel with VBA. (code attached) The sheet has 4 columns, but only columns A and B are important here. Column A has an alphabetic list of Artists and for each Artist, column B has a list of Songs for that Artist. The data is divided logically into alphabetical segments with a header row (e.g. 'A B C', 'D E F'). Here is an example of the data: A B C Artist Song Adele Hometown Glory Make You Feel My Love One And Only Someone Like You Albert E. Brumley I'll Fly Away Alison Krauss A Living Prayer Baby, Now That I've Found You But You Know I Love You Forget About It Ghost In This House Oh, Atlanta Stay When You Say Nothing At All Amos Lee Arms Of A woman Black River Whenever Excel's natural page break lands in the middle of a song list, I want to back up and force a page break just before the name of the artist in column A so that the artist and all associated songs start at the top of the next page. Likewise, if the last row on a page is one of the header rows, I want to bump that row to the top of the next page. My code does this nicely, but only when I am in debug mode and slowly stepping through it. If I get out of debug mode and 'let 'er rip' the code works for the first case where I insert a page break but then does not work for the remaining situations where it inserts a page break. In a post somewhere (cannot remember the web site or post topic) someone suggested that when you insert a page break, Excel communicates with the printer. Thus, when I am stepping slowly through the code in debug mode, there is plenty of time for that. But when I run the code normally, there is not enough time to accomplish that for the newly inserted page break before the code races along to handle the next situation. ![]() I have tried inserting 'Do Events' and 'Wait' instructions (e.g. Wait 10 seconds), but neither of them has any effect. Is there any better way to insert page breaks? (That will be better, but hopefully not super slow.). First of all, nice selection of music! I fired up my Alison Krauss playlist while working on this.:-) I had to add several more rows of example artists and titles to test. • • It does a good job in showing how your web site will look on latest gadgets • • It has a simple interface and nicely done transitions. Downside: • • Does not account for rendering differences between devices Link. When I only had two pages of data, it ran fine in real-time. I had an issue after I added third page of data, in which case it only adjusted the first page break but not the second. So I added a Wait method of just one second and that seems to work. See the attached example file with this section of modified code at the bottom: If currRow origRow Then rng.EntireRow.Select ActiveWindow.SelectedSheets.HPageBreaks.Add Before:=ActiveCell Application.Wait (Now + TimeValue('0:00:01')) End If Select all -Glenn. As I indicated in my original question I tried the Wait method also and it did not work. My actual data is 254 rows long. You might have had different results with that much data. I have attached a sample file with the full data in it.
0 Comments
Leave a Reply. |