+ Reply to Thread
Results 1 to 4 of 4

macro to set page break before empty cell

  1. #1
    Registered User
    Join Date
    09-04-2013
    Location
    white river,south africa
    MS-Off Ver
    2010
    Posts
    9

    macro to set page break before empty cell

    Hi
    I need a macro to insert a page break before each empty cell in column k. The print range is from a14 down. There are empty rows after each change in data which will have a page break.

    Thanks

  2. #2
    Forum Expert JasperD's Avatar
    Join Date
    05-07-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2016
    Posts
    1,393

    Re: macro to set page break before empty cell

    How about something like this ?

    Please Login or Register  to view this content.
    Please click the * below if this helps
    Please click the * below if this helps

  3. #3
    Registered User
    Join Date
    09-04-2013
    Location
    white river,south africa
    MS-Off Ver
    2010
    Posts
    9

    Re: macro to set page break before empty cell

    I get a error on this line
    HPageBreaks.Add Before:=cell

  4. #4
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: macro to set page break before empty cell

    Hi, jdvdh001,

    imaybe it should read ActiveSheet.HPageBreaks.Add Before:=cell.

    Please Login or Register  to view this content.
    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

+ 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. Replies: 1
    Last Post: 01-28-2013, 02:14 AM
  2. page break or page set up in macro
    By somusas in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-18-2012, 01:04 AM
  3. Applying page break function conditionally on the basis of cell value using macro
    By crusader2010 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-02-2010, 11:50 PM
  4. Replies: 0
    Last Post: 03-22-2009, 10:52 PM
  5. [SOLVED] Page break Macro
    By Gaz in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-22-2005, 06:20 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