+ Reply to Thread
Results 1 to 4 of 4

Conditionally Delete Row and Place Page Break

  1. #1
    Registered User
    Join Date
    12-07-2007
    Location
    Philadelphia, PA
    Posts
    18

    Conditionally Delete Row and Place Page Break

    Hello,

    I'm trying to write a macro that looks through Column A, finds any cell with the word "Page Break", deletes that row, and adds a Horizontal Page Break in its stead. Also, since there are already incorrect Horizontal PageBreaks, is there a way to take those out while keeping the good ones (from the macro) in? Can anyone help me?

    Thanks a bunch in advance! =D

    John

  2. #2
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Conditionally Delete Row and Place Page Break

    See if this works for you. Unfortunately, there is no way to know what is a "bad" page break. This code will remove all existing page breaks and then insert them as you specify given the work "page break" in a cell.

    Please Login or Register  to view this content.
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

  3. #3
    Registered User
    Join Date
    12-07-2007
    Location
    Philadelphia, PA
    Posts
    18

    Re: Conditionally Delete Row and Place Page Break

    Hi Palmetto,

    That was great help - thanks so much! The final code ended up being this:

    Please Login or Register  to view this content.
    I opted to hide the row instead of deleting it since another macro I have uses the "...Page Break..." as a reference as well.

    Thanks again! =D

  4. #4
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Conditionally Delete Row and Place Page Break

    Glad to have been of help.

    If you are satisfied with your solution please mark this thread as solved by going to the top of your first post and clicking on Thread Tools, then Go Advanced and choose the [SOLVED] prefix.

    Thanks for posting your complete solution. Others will benefit from it.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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