Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.misc
Ron de Bruin
 
Posts: n/a
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Returning Results Based on Two Criteria [email protected] Excel Worksheet Functions 7 October 23rd 05 02:53 PM
Find largest alphanumeric value matching alpha criteria in databas Alison Excel Worksheet Functions 7 August 4th 05 06:59 PM
sorting more than 3 keys Brooke Excel Discussion (Misc queries) 3 June 18th 05 04:52 AM
SUMPRODUCT Formula to Count Row of data Below Matched Criteria Sam via OfficeKB.com Excel Worksheet Functions 8 February 3rd 05 01:37 AM
problem printing to PDF mark kubicki Excel Discussion (Misc queries) 1 January 21st 05 06:19 PM


All times are GMT +1. The time now is 08:41 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"