+ Reply to Thread
Results 1 to 6 of 6

Loop through visible cells and every x..th cell add page break.

  1. #1
    Registered User
    Join Date
    03-03-2015
    Location
    USA
    MS-Off Ver
    Office 2013
    Posts
    9

    Loop through visible cells and every x..th cell add page break.

    I want loop through only visible cells in a worksheet thats print area is variable and set a page break for every so many cells. Then I want to select that range and use it as my print area. Currently, I am not looping and have a helper cell with formulas telling my macro to start at that cell. My code is selecting the header column and creating one to many sheets for my print area. Please help!


    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,840

    Re: Loop through visible cells and every x..th cell add page break.

    Try this code
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    03-03-2015
    Location
    USA
    MS-Off Ver
    Office 2013
    Posts
    9

    Re: Loop through visible cells and every x..th cell add page break.

    Thank you! That worked better than my last code. Still having an issue unfornately. Excel at my start row is automatically creating a page break any reason this is happening. I have two hidden rows and a header that repeates at the top? Is there anyway to change to the print area to start at the start row?
    Last edited by tuc47285; 03-05-2015 at 04:41 PM.

  4. #4
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,840

    Re: Loop through visible cells and every x..th cell add page break.

    I think it's better to attach your file to see it

  5. #5
    Registered User
    Join Date
    03-03-2015
    Location
    USA
    MS-Off Ver
    Office 2013
    Posts
    9

    Re: Loop through visible cells and every x..th cell add page break.

    I attached teh workbook.
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,840

    Re: Loop through visible cells and every x..th cell add page break.

    I didn't get exactly what you want
    But try to change this line
    Please Login or Register  to view this content.

+ 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. Select visible range and add page break after every 20th visible cell
    By tuc47285 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-04-2015, 01:18 AM
  2. Find First match value and add page break, findnext value and add page break
    By dwx in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-20-2013, 12:58 PM
  3. Replies: 1
    Last Post: 01-28-2013, 02:14 AM
  4. Macro To Loop And Insert a Page-break
    By SgtPb in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-03-2010, 12:04 PM
  5. [SOLVED] loop on visible cells only
    By Sliman in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-26-2006, 09:10 PM

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