Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 wrote in message ups.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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Returning Results Based on Two Criteria | Excel Worksheet Functions | |||
Find largest alphanumeric value matching alpha criteria in databas | Excel Worksheet Functions | |||
sorting more than 3 keys | Excel Discussion (Misc queries) | |||
SUMPRODUCT Formula to Count Row of data Below Matched Criteria | Excel Worksheet Functions | |||
problem printing to PDF | Excel Discussion (Misc queries) |