+ Reply to Thread
Results 1 to 5 of 5

Applying page break function conditionally on the basis of cell value using macro

  1. #1
    Registered User
    Join Date
    07-31-2010
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    3

    Talking Applying page break function conditionally on the basis of cell value using macro

    Hi gurus,
    Presently I need to develop a macro that can apply page break in excel 2002 on the basis of the values of a particular column in the excel

    example
    CURRENT EXCEL

    Print Output in 1st page

    Col1 Col2

    1 a
    0 b
    0 c
    1 d
    0 e
    1 f
    0 g
    0 h


    I need to apply page break before the last cell value of col1 when the cell value=1using the macro mentioned below.

    EXCEL REQUIRED AFTER APPLYING CONDITIONAL PAGE BREAK USING MACRO
    Print Output in 1st page

    Col1 Col2

    1 a
    0 b
    0 c
    1 d
    0 e

    Print Output in 2nd page
    Col1 Col2

    1 f
    0 g
    0 h


    MACRO DEVELOPED SO FAR
    ----------------------------------------------START------------------------------------------------
    Please Login or Register  to view this content.
    ----------------------------------------------END-------------------------------------------------------------


    Please help ASAP
    Thanks
    Last edited by pike; 07-31-2010 at 05:58 AM. Reason: code tags for newbie pm rules

  2. #2
    Forum Expert Simon Lloyd's Avatar
    Join Date
    03-02-2004
    Location
    locked in the cage
    MS-Off Ver
    All the ones my homepage shows
    Posts
    3,161

    Re: Applying page break function conditionally on the basis of cell value using macro

    I don't understand in your example you show your first page break after 0? is that where you want it or when it finds a 1? also what determines that it shouldn't be the first 1 that it comes across?
    Not all forums are the same - seek and you shall find

  3. #3
    Registered User
    Join Date
    07-31-2010
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Applying page break function conditionally on the basis of cell value using macro

    I want to apply page break before the last value for Col1=1
    In the examle that I mentioned above
    Print Output in 1st page

    Col1 Col2

    1 a
    0 b
    0 c
    1 d
    0 e

    Print Output in 2nd page
    Col1 Col2

    1 f
    0 g
    0 h

    In the row where Col2 value = f we get the corresponding Col1 value =1 which is the last Col1 value where it equals 1.
    So I want to apply page break before this row in my excel sheet.
    Last edited by crusader2010; 08-02-2010 at 11:29 AM.

  4. #4
    Forum Expert Simon Lloyd's Avatar
    Join Date
    03-02-2004
    Location
    locked in the cage
    MS-Off Ver
    All the ones my homepage shows
    Posts
    3,161

    Re: Applying page break function conditionally on the basis of cell value using macro

    I'm sorry but it still makes no sense to me!!!
    want to apply page break before the last value for Col1=1
    so in your example the page break would come after "0h" as zero is a value, it's just not a positive nor negative value!

    How about supplying a workbook with a before sheet that has data similar to that which you will be using with another sheet showing the "after" look.

  5. #5
    Registered User
    Join Date
    07-31-2010
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Applying page break function conditionally on the basis of cell value using macro

    Hi Simon,
    I have uploaded a excel sheet specifying my requirement more clearly .
    Hope this will make my case more clear to you.
    Please help ASAP.

    Thanks
    Attached Files Attached Files
    Last edited by crusader2010; 08-03-2010 at 12:16 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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