ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Conditional Worksheet Printing... (https://www.excelbanter.com/excel-programming/377212-conditional-worksheet-printing.html)

ScooterJB

Conditional Worksheet Printing...
 
Hey all, I'm kinda new here but I was wondering if anyone has any tips
to get me started on this...

I have a workbook with 39 worksheets, all structured the same where I'd
enter a list with costs and a total formula at the bottom of each,
entered and printed every week. If the total at the bottom of the
sheets (all in F24 to make thigs that much easier for me) is zero,
meaning there are no entries on that sheet for the week, I simply don't
print that sheet.

Obviously, I want to create a module that I can apply to a button that
will automatically look at all 39 sheets and select, group together,
the ones where the total does not equal zero. Basically, the sheets
that have entries on them, group them and print them. (Keeping in mind
the totals could be negarive values as well.)

I haven't got anything yet as I mentioned I'm quite new with learning
all of this but would love a place to start and get better from.

Thanx all in advance for your help...

Scott


Bernie Deitrick

Conditional Worksheet Printing...
 
Scott,

No need to group:

Dim mySh As Worksheet

For Each mySh In ActiveWorkbook.Worksheets
If mySh.Range("F24").Value < 0 Then mySh.Printout
Next mySh

HTH,
Bernie
MS Excel MVP


"ScooterJB" wrote in message
ups.com...
Hey all, I'm kinda new here but I was wondering if anyone has any tips
to get me started on this...

I have a workbook with 39 worksheets, all structured the same where I'd
enter a list with costs and a total formula at the bottom of each,
entered and printed every week. If the total at the bottom of the
sheets (all in F24 to make thigs that much easier for me) is zero,
meaning there are no entries on that sheet for the week, I simply don't
print that sheet.

Obviously, I want to create a module that I can apply to a button that
will automatically look at all 39 sheets and select, group together,
the ones where the total does not equal zero. Basically, the sheets
that have entries on them, group them and print them. (Keeping in mind
the totals could be negarive values as well.)

I haven't got anything yet as I mentioned I'm quite new with learning
all of this but would love a place to start and get better from.

Thanx all in advance for your help...

Scott




ScooterJB

Conditional Worksheet Printing...
 
Actually, I would like to group because I want to create a a module
that will collate printed pages and print them multiple times based on
an input...


Bernie Deitrick

Conditional Worksheet Printing...
 
Scooter,

Sub TryNow()
Dim mySh As Worksheet
Dim bSel As Boolean

bSel = True

For Each mySh In ActiveWorkbook.Worksheets
If mySh.Range("F24").Value < 0 Then
If bSel Then
mySh.Select
bSel = False
Else
mySh.Select False
End If
End If
Next mySh

End Sub


HTH,
Bernie
MS Excel MVP


"ScooterJB" wrote in message
oups.com...
Actually, I would like to group because I want to create a a module
that will collate printed pages and print them multiple times based on
an input...





All times are GMT +1. The time now is 02:30 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com