+ Reply to Thread
Results 1 to 9 of 9

PageBreak and Insert the value in Header based on a cell value (Lookup)

  1. #1
    Registered User
    Join Date
    04-15-2008
    Location
    Tamil Nadu, India.
    MS-Off Ver
    Microsoft Office 2016
    Posts
    582

    Smile PageBreak and Insert the value in Header based on a cell value (Lookup)

    Dear Friends,

    I have a worksheet (DATASHEET) consists around 8000 rows. Every 48 to 50 rows are of one group. In LOOKUPS sheet I have a named range.

    I need to put PageBreak in DATASHEET and insert a Lookup Value in PageHeader based on a range in another sheet.

    I explained, in detail, in the attached file.

    Thanks a lot in advance,

    acsishere.
    Attached Files Attached Files

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello ,

    Here is a partial solution to your problem. The macro shown here has been added to the attached workbook. This will add horizontal page breaks based on the LOOKUPS groups. A button has been added to the sheet to make running the macro easier.

    There is a problem with printing the right header. Since the header is part of the worksheet and not the print area, only a single page from the worksheet can be printed at a time if you want the header to match the group. Another macro would be required to properly control the printout.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    04-15-2008
    Location
    Tamil Nadu, India.
    MS-Off Ver
    Microsoft Office 2016
    Posts
    582

    Smile Dear Sir,

    Excellent! Thanks for the partial solution. It's nice & neat. Thanks for the same.

    Any help to insert the Page Header in each page according to the cell value?

    i.e. A macro should find the value in colA of that page & accordingly it should Lookup the value from the list in the another sheet to insert the same in the page Header.

    Any help is highly appreciated.

    acsishere.

  4. #4
    Registered User
    Join Date
    04-15-2008
    Location
    Tamil Nadu, India.
    MS-Off Ver
    Microsoft Office 2016
    Posts
    582

    Smile Dear Sir,

    I applied the PageBreak code into the workbook. It works very nicely. But I am facing a small problem in it.

    i.e. The code is not removing the earlier pagebreaks. Ofcourse, if the file is reopened the PageBreak lines are disappearing. But, when we run the code once again, I observed the following:

    1) It applies the pagebreak first time correctly.
    2) Second time if run, then pagebreak appears just one row before the last row of every group.
    3) If we make changes in the data, and then we run the code, then also the earlier pagebreaks appears. And the last row of each group is separated as another page.

    What modification is required in the code?

    Thanks a lot, in advance.

    acsishere.

  5. #5
    Registered User
    Join Date
    04-15-2008
    Location
    Tamil Nadu, India.
    MS-Off Ver
    Microsoft Office 2016
    Posts
    582

    Smile Dear Sir,

    Any help?

    Thanks in advance.

    acsishere.

  6. #6
    Registered User
    Join Date
    04-15-2008
    Location
    Tamil Nadu, India.
    MS-Off Ver
    Microsoft Office 2016
    Posts
    582

    Smile Dear Friends,

    This is regarding the PageBreak query. I got somewhat similar code for PageBreak based on a group in a worksheet. The thread is:

    http://www.excelforum.com/showthread.php?t=609066

    A file is also attached with it (I tried with this). The data in colA consists of dates. When I tried to do pagebreak with the code in the file, it works nicely. Initially, after pagebreak, the no. of pages are 5.

    Now, I added a date at the last row (that too of same as previous row).
    Then the code was once again applied. It breaks into 6 pages (instead of 5 pages).

    Actually, the code once again should break into only 5 pages. Because the date which I entered is also a same as in the previous row. Whereas, it breaks only the last row as a separate page.

    The code in my thread is also having the same problem:
    My thread is:
    http://www.excelforum.com/showthread.php?t=647769

    Can any one please help me to find the solution?

    Thanks in advance,

    acsishere.

  7. #7
    Registered User
    Join Date
    04-15-2008
    Location
    Tamil Nadu, India.
    MS-Off Ver
    Microsoft Office 2016
    Posts
    582

    Smile Dear Friends,

    Any solution?

    Thanks in advance.

    acsishere.

  8. #8
    Registered User
    Join Date
    04-15-2008
    Location
    Tamil Nadu, India.
    MS-Off Ver
    Microsoft Office 2016
    Posts
    582

    Smile Dear Friends,

    Any help is highly appreciated.

    Please....

    Thanks a lot, in advance.

    acsishere.

  9. #9
    Registered User
    Join Date
    04-15-2008
    Location
    Tamil Nadu, India.
    MS-Off Ver
    Microsoft Office 2016
    Posts
    582

    Smile Dear Friends,

    Is it possible? Or any other alternatives?

    Please suggest me.

    Thanks in advance.

    acsishere.

+ 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