+ Reply to Thread
Results 1 to 6 of 6

Macro for Printing Only Completed Sheets

  1. #1
    Registered User
    Join Date
    10-08-2019
    Location
    US
    MS-Off Ver
    2010
    Posts
    5

    Macro for Printing Only Completed Sheets

    I have a workbook with about 40 sheets that autopopulates with data (times, activities, etc.) from a second workbook. I added a macro to the first workbook to print only those sheets that contain a date in cell B3. However, when I run the macro it still prints the sheets with no date in B3 along with the rest of the sheets. Here is the printing macro for the first workbook:

    Sub PrintCompleted()
    Dim notes As Worksheet
    For Each notes In ActiveWorkbook.Worksheets
    If Not IsEmpty(notes.Range("B3")) Then
    notes.PrintOut
    End If
    Next
    End Sub

    The cell B3 in each sheet contains some variation on the following formula to conditionally pull the date from the second workbook:

    =IF(K40="","",'C:\Users\thisUser\Notes\[Activities_Attendence.xlsx]W110'!$I$1)

    I'd appreciate any help with sorting out why the macro doesn't function as expected. Thanks!

  2. #2
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Macro for Printing Only Completed Sheets

    .
    What about this change ?


    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    10-08-2019
    Location
    US
    MS-Off Ver
    2010
    Posts
    5

    Re: Macro for Printing Only Completed Sheets

    I tried IsEmpty(notes.Range("B3")) = False, but that also did not work. Thanks for the suggestion though!

  4. #4
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Macro for Printing Only Completed Sheets

    .
    Tested and works here :

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    10-08-2019
    Location
    US
    MS-Off Ver
    2010
    Posts
    5

    Re: Macro for Printing Only Completed Sheets

    I tested your macro with a MsgBox instead of PrintOut and it worked a trick. Thank you so much! You've saved me a lot of frustration and paper.

  6. #6
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Macro for Printing Only Completed Sheets

    .
    Glad to help !

    Cheers.

+ 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. macro for printing sheets based on drop-down list selection
    By carrollkm in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-26-2013, 10:36 PM
  2. Replies: 0
    Last Post: 10-28-2013, 04:08 AM
  3. Comparing 2 sheets and highlighting completed values
    By norrillous in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-05-2013, 02:44 AM
  4. Excel macro for printing multiple sheets...
    By nicklas in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 09-11-2012, 11:22 AM
  5. Printing Macro, set workbook to only print certain sheets
    By AMFISH in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-19-2012, 04:37 PM
  6. Print macro printing sheets in wrong order
    By j.farr3ll in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-08-2011, 09:12 AM
  7. Restrict printing unless certain cells are completed
    By m0llydog in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-30-2007, 08:01 AM
  8. [SOLVED] How to restrict printing to only completed tables in spreadsheet?.
    By Karen@NS in forum Excel General
    Replies: 0
    Last Post: 06-21-2006, 02:50 PM

Tags for this Thread

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