+ Reply to Thread
Results 1 to 5 of 5

Clear all page breaks, then insert new breaks at change in data

  1. #1
    Registered User
    Join Date
    05-16-2014
    MS-Off Ver
    Excel 2003
    Posts
    10

    Clear all page breaks, then insert new breaks at change in data

    I barely know how to scratch the surface of VBA, so I need some help. Trying to clear all previous page breaks, and then insert new breaks when data in column C changes, beginning with row 2. If possibly to build it in there, I'd also like to add row 1 headers to each page to print. And do I need a different code for each individual worksheet or just one? Thanks!

  2. #2
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: Clear all page breaks, then insert new breaks at change in data

    Simplistic in the extreme (My example - not your problem!)
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    05-16-2014
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Clear all page breaks, then insert new breaks at change in data

    Is there a way to add sorting column C at the beginning? Thanks for the reply.

  4. #4
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: Clear all page breaks, then insert new breaks at change in data

    Use the macro recorder and get some basic code while you step though it yourself

  5. #5
    Registered User
    Join Date
    05-16-2014
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Clear all page breaks, then insert new breaks at change in data

    So it now does what I was looking for, but there's one more thing I want to do. The sheet sorts my data in column C, then inserts a page break when that value changes. The problem I'm having now is that I used my header from Row 1 to print with all sheets, but if I filter my data down, it prints empty sheets with headers. So if all of my data creates 18 pages, I want to filter it down by something and only print the 5 remaining with data, but 5 print with data, and 13 print with only a header. How can I avoid printing those 13?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. VBA to insert page breaks
    By jordan2322 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-27-2012, 11:27 PM
  2. Insert Page Breaks
    By NickHubble in forum Excel General
    Replies: 1
    Last Post: 04-05-2010, 08:07 AM
  3. Replies: 1
    Last Post: 03-15-2009, 06:08 PM
  4. macro to insert page breaks
    By jah72773 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-30-2008, 06:16 PM
  5. Hard page breaks being replaced by soft breaks in the wrong place
    By JDavies in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-14-2008, 10:28 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1