+ Reply to Thread
Results 1 to 2 of 2

Printing certain criteria

  1. #1
    jns1999@aol.com
    Guest

    Printing certain criteria

    I am interested in learning how to use criteria to print only certain
    sheets as well. Here is my scenario:

    I have approximately 500 sheets and each sheet contains a total. I
    only want to print the sheets that have a total of $20 or greater. Is
    this possible? If so, please inform me step by step because I do not
    have much experience with macros.


    Thanks,

    Justin


  2. #2
    Ron de Bruin
    Guest

    Re: Printing certain criteria

    Try this Justin

    It test cell A1 for the value > 20
    Try it first on a test workbook with 10 sheets or so


    Sub Print_Visible_Worksheets()
    'xlSheetVisible = -1
    Dim sh As Worksheet
    Dim arr() As String
    Dim N As Integer
    N = 0
    For Each sh In ThisWorkbook.Worksheets
    If sh.Visible = -1 And sh.Range("A1") > 20 Then
    N = N + 1
    ReDim Preserve arr(1 To N)
    arr(N) = sh.Name
    End If
    Next
    With ThisWorkbook
    .Worksheets(arr).PrintOut
    .Worksheets(1).Select
    End With
    End Sub


    --
    Regards Ron de Bruin
    http://www.rondebruin.nl


    <jns1999@aol.com> wrote in message news:1138121015.550013.27440@o13g2000cwo.googlegroups.com...
    >I am interested in learning how to use criteria to print only certain
    > sheets as well. Here is my scenario:
    >
    > I have approximately 500 sheets and each sheet contains a total. I
    > only want to print the sheets that have a total of $20 or greater. Is
    > this possible? If so, please inform me step by step because I do not
    > have much experience with macros.
    >
    >
    > Thanks,
    >
    > Justin
    >




+ 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