Hi
I use the following macro to print pages with data but, have added another worksheet that is filled with data that I do not wish to print. Can you help please with how I exclude a worksheet called Time Calc?
Dim sht As Integer
Sub Conditional_Print()
'this will work from any sheet
Dim rRng As Range
Dim rCl As Range
sht = 0
Set rRng = Worksheets("Machine logo costs").Range("K66:K74")
For Each rCl In rRng
sht = sht + 1
PrintSht (rCl.Value)
Next rCl
End Sub
Sub PrintSht(OK As Boolean)
'don't print empty sheets
On Error Resume Next
If WorksheetFunction.CountA(Worksheets(sht).Cells) = 0 Then OK = False
If OK = True Then Worksheets(sht).PrintOut
exit_proc:
On Error GoTo 0
End Sub
Bookmarks