+ Reply to Thread
Results 1 to 4 of 4

Can only get page to print properly if I press enter within the worksheet being printed.

  1. #1
    Registered User
    Join Date
    07-27-2013
    Location
    Roanoke
    MS-Off Ver
    Excel 2019
    Posts
    64

    Can only get page to print properly if I press enter within the worksheet being printed.

    I have a workbook that contains over 20 worksheets (I have dummed it down for the test files that are attached).

    In the QC worksheet (tab), In Column C (Range 5:1444), the user will enter comments as needed. Then, in the C-Build worksheet, those comments are stacked. The resulting report is located in the Comments worksheet.

    The attached Macro will print out the Comments page to a pdf.

    After manually changing comments in Column C in QC Worksheet, the Comments page looks right.

    However, unless I do this -the printout will not work: IF I press ENTER in any unused cell (say in column G) of the Comments worksheet, then SAVE. It prints fine.

    If you don't press ENTER in an unused cell in Comments worksheet, then the pdf only prints the first line of comments.

    I tried adding SENDKEY in the macro but never could get that to work.

    Of course, the workaround will be just to notify the user he/she will just need to go to the Comments tab and press ENTER in one of the cells (not in A:C).

    Any thoughts?

    Thanks!

    Please Login or Register  to view this content.

    I have attaced the MACRO (only use STEP 4, after changing your paths as mentioned in the macro example). Also, the QC Spreadsheet and 2 png examples of a good and bad printout.
    Attached Images Attached Images
    Attached Files Attached Files

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,613

    Re: Can only get page to print properly if I press enter within the worksheet being printe

    This runs through, from end to end, and produces the .pdf file without selecting anything in the Comments worksheet.

    The problem was that the workbook and worksheets needed to be qualified to ensure the right workbook, sheet and range were being used to determine the last row. "Pressing enter on an unused cell" actually caused the Comment sheet to be the active sheet. This, in turn, meant the last row was calculated based on data in column C on the Comments sheet. Without that intervention, the last row would have been calculated based on the data on whatever sheet was active when the source workbook was saved, whic I suspect was RAW.

    Please Login or Register  to view this content.
    Last edited by TMS; 07-13-2024 at 06:30 PM.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    07-27-2013
    Location
    Roanoke
    MS-Off Ver
    Excel 2019
    Posts
    64

    Re: Can only get page to print properly if I press enter within the worksheet being printe

    Wow TMS! That did the trick. This stuff can be very complicated. So glad there's great people on this forum to help us novices out. Thank you so much!

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,613

    Re: Can only get page to print properly if I press enter within the worksheet being printe

    You're welcome. Thanks for the rep.

+ 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. [SOLVED] Print sequential page numbers on one worksheet printed multiple ti
    By 2 hard basket in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 10:05 AM
  2. [SOLVED] Print sequential page numbers on one worksheet printed multiple ti
    By Damon Longworth in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-06-2005, 07:05 AM
  3. [SOLVED] Print sequential page numbers on one worksheet printed multiple ti
    By Damon Longworth in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-06-2005, 04:05 AM
  4. Print sequential page numbers on one worksheet printed multiple ti
    By 2 hard basket in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 01:05 AM
  5. Print sequential page numbers on one worksheet printed multiple ti
    By 2 hard basket in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 11:05 PM
  6. [SOLVED] Print sequential page numbers on one worksheet printed multiple ti
    By 2 hard basket in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 PM
  7. how to print the worksheet name somewhere on the printed page ?
    By Simo Sentissi in forum Excel General
    Replies: 3
    Last Post: 08-20-2005, 02:05 AM
  8. Print sequential page numbers on one worksheet printed multiple ti
    By 2 hard basket in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-04-2005, 10:05 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