+ Reply to Thread
Results 1 to 12 of 12

Print worksheet

  1. #1
    Forum Contributor
    Join Date
    11-13-2013
    Location
    Florida
    MS-Off Ver
    Excel 2010
    Posts
    464

    Print worksheet

    Hi,
    I have a Command Button to print a worksheet. On that worksheet, there are potentially several hundred rows of data in A:M. The rows are only filled under certain circumstances, but the formula to populate them has been copied down the sheet to infinity. When I try to print the sheet, it wants to print cells that are blank but have a formula contained in them. Does anyone know how I can only print those cells that contain text and not the ones that are blank and only contain formulas?

    Thank you!

  2. #2
    Valued Forum Contributor
    Join Date
    12-02-2012
    Location
    Melbourne, VIC
    MS-Off Ver
    Excel 2016
    Posts
    750

    Re: Print worksheet

    you can specify the range to print using
    Please Login or Register  to view this content.
    search this forum or google for examples.
    Good luck

  3. #3
    Forum Contributor
    Join Date
    11-13-2013
    Location
    Florida
    MS-Off Ver
    Excel 2010
    Posts
    464

    Re: Print worksheet

    Thanks for the help. The print area will be undefined though. Each month may have a different number of occupied cells, and the end-users for this will not know how to search or filter for this.

  4. #4
    Valued Forum Contributor
    Join Date
    12-02-2012
    Location
    Melbourne, VIC
    MS-Off Ver
    Excel 2016
    Posts
    750

    Re: Print worksheet

    Mate, try to set the print area conditionally based on the last occupied cell. Something like this:
    Please Login or Register  to view this content.
    HTH!

  5. #5
    Forum Contributor
    Join Date
    11-13-2013
    Location
    Florida
    MS-Off Ver
    Excel 2010
    Posts
    464

    Re: Print worksheet

    Thanks. I added the command, and it froze everything up for a few seconds and nothing printed. Here's the workbook as it is now.
    Attached Files Attached Files

  6. #6
    Valued Forum Contributor
    Join Date
    12-02-2012
    Location
    Melbourne, VIC
    MS-Off Ver
    Excel 2016
    Posts
    750

    Re: Print worksheet

    Mate, I was hoping that you will replace the following part of the code with the printout code:
    Please Login or Register  to view this content.
    Nevermind, try this instead:
    Please Login or Register  to view this content.
    Also see attached - Teletype Form 3.xlsm
    HTH!

  7. #7
    Forum Contributor
    Join Date
    11-13-2013
    Location
    Florida
    MS-Off Ver
    Excel 2010
    Posts
    464

    Re: Print worksheet

    Sorry man. Thanks. I will give it a go when I return to work tomorrow. Thank you!

  8. #8
    Forum Contributor
    Join Date
    11-13-2013
    Location
    Florida
    MS-Off Ver
    Excel 2010
    Posts
    464

    Re: Print worksheet

    Worked like a charm!!!! For your code, if the user inadvertently hits the button to print and the ComboBox is still blank, how could I prevent unnecessary copies? Since this is triggering an auto-print, I also don't want the user to print the last report...only the one currently being requested.

  9. #9
    Valued Forum Contributor
    Join Date
    12-02-2012
    Location
    Melbourne, VIC
    MS-Off Ver
    Excel 2016
    Posts
    750

    Re: Print worksheet

    To prevent inadvertent printing see attached - Teletype Form 3.xlsm
    I'm not really sure by what is implied by
    I also don't want the user to print the last report...only the one currently being requested.
    Please exemplify.

  10. #10
    Forum Contributor
    Join Date
    11-13-2013
    Location
    Florida
    MS-Off Ver
    Excel 2010
    Posts
    464

    Re: Print worksheet

    If the user accidentally hits the Print button rather than the submit, it will reprint the last month requested since that information still appears on the sheet.

    Can it be altered to a Print Preview so that only certain pages can be printed? The document could be extremely long depending upon how much was done during the month.

  11. #11
    Registered User
    Join Date
    07-17-2014
    Location
    Turkey
    MS-Off Ver
    2003
    Posts
    85

    Re: Print worksheet

    Please Login or Register  to view this content.
    or

    Please Login or Register  to view this content.
    or

    Please Login or Register  to view this content.

  12. #12
    Forum Contributor
    Join Date
    11-13-2013
    Location
    Florida
    MS-Off Ver
    Excel 2010
    Posts
    464

    Re: Print worksheet

    Please Login or Register  to view this content.
    My apologies, I posted an earlier version of the code. At the top you will see my failed attempt to get it to work. Apparently, I'm missing Do

+ 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: 8
    Last Post: 07-17-2014, 04:33 PM
  2. Replies: 3
    Last Post: 05-26-2014, 02:21 AM
  3. Randomly sample 30 columns from worksheet input and print them in worksheet Output
    By Savan87 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-05-2012, 01:00 PM
  4. [SOLVED] Macro to print the current worksheet WITHOUT having Print Preview
    By terrydennis in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-06-2012, 11:00 AM
  5. VBA code to print several print areas in one worksheet
    By ABSTRAKTUS in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-25-2010, 03:24 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