+ Reply to Thread
Results 1 to 6 of 6

Insert Page Break After Every Item VBA

  1. #1
    Registered User
    Join Date
    04-24-2019
    Location
    Vancouver, BC
    MS-Off Ver
    365
    Posts
    5

    Angry Insert Page Break After Every Item VBA

    Hi everybody. I am trying to write VBA to insert Page Breaks after every Pivot Table item in column A. The Field Settings are not working for some reason and page breaks end up all over the place. I have the code below to insert a page break every time the cell value changes but I don't want to fill the item in every cell, want to have the titles distributed like they are in the screenshot (which is an excerpt from a very long table).

    I also don't want the code to start until row 4 when the items begin. If anyone could help me that'd be great! I've been researching stuff to solve this problem for a while but can't seem to be able to put the right pieces together (I'm very new at VBA)

    Please Login or Register  to view this content.
    ExcelHelp (2).PNG
    Last edited by ilibera; 04-26-2019 at 06:16 PM.

  2. #2
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,742

    Re: Insert Page Break After Every Item VBA

    This:

    Please Login or Register  to view this content.
    gives like this:

    Przechwytywanie.JPG

    If I found you need correctly.
    Happy with my answer * Add Reputation.
    If You are happy with solution, please use Thread tools and mark thread as SOLVED.

  3. #3
    Registered User
    Join Date
    04-24-2019
    Location
    Vancouver, BC
    MS-Off Ver
    365
    Posts
    5

    Re: Insert Page Break After Every Item VBA

    This (almost) perfect thank you! How would i change this slightly to make it start AFTER the first project?

  4. #4
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Insert Page Break After Every Item VBA

    Well this doesn't actually work from top to bottom, rather, it's bottom to top.

    Please Login or Register  to view this content.
    This goes from row 13 and works backwards to row 5. Try doing this...

    Please Login or Register  to view this content.
    HTH
    Regards, Jeff

  5. #5
    Registered User
    Join Date
    04-24-2019
    Location
    Vancouver, BC
    MS-Off Ver
    365
    Posts
    5

    Re: Insert Page Break After Every Item VBA

    Thanks everyone! Wish I had asked about this a week ago, y'all rock.

  6. #6
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Insert Page Break After Every Item VBA

    You are very welcome and thanks for the feedback. We are happy to help.

+ 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. [SOLVED] vba to insert page break best on len
    By scrabtree23 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-30-2015, 07:56 AM
  2. [SOLVED] Insert page break
    By BRISBANEBOB in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-05-2014, 04:49 PM
  3. Insert blank row, sum and insert page break macro
    By kim5012 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-06-2012, 01:46 AM
  4. insert page header after page break
    By dgkindy in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-17-2009, 10:35 AM
  5. [SOLVED] insert page break
    By ruben via OfficeKB.com in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-11-2006, 07:00 AM
  6. cannot insert page break
    By tsmanz in forum Excel General
    Replies: 2
    Last Post: 12-05-2005, 01:50 PM
  7. [SOLVED] Insert Page Break
    By Don in forum Excel General
    Replies: 3
    Last Post: 06-09-2005, 04:05 PM

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