+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    09-26-2008
    Location
    Richmond
    Posts
    56

    Print all tabs where cell "D2" is > ""

    I need a macro that will print all tabs where cell D2 has any data in it.....any help would be appreciated. I need to make sure the macro does not include the tab's names since they will change quiet often and people come and go.

    Thanks!

  2. #2
    Forum Guru Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007
    Posts
    3,441

    Re: Print all tabs where cell "D2" is > ""

    Code:
    Option Explicit
    
    Sub Print_Sheets()
    
        Dim ws As Worksheet
        
        On Error Resume Next
        For Each ws In ThisWorkbook.Worksheets
                If Range("D2") <> "" Then ws.PrintOut
        Next ws
    
    End Sub
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

  3. #3
    Valued Forum Contributor Rick_Stanich's Avatar
    Join Date
    11-21-2005
    Location
    Eastlake Ohio
    MS-Off Ver
    2010
    Posts
    1,000

    Re: Print all tabs where cell "D2" is > ""

    Code:
    Sub aaa()
        For Each ws In ThisWorkbook.Worksheets
            If ws.Range("D2").Value <> "" Then
                ws.PrintOut Copies:=1, Collate:=True
            End If
        Next ws
    End Sub
    Edit:
    Must learn to use refresh button
    Regards

    Rick
    Win7, Office 2010

Thread Information

Users Browsing this Thread

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

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.2.0