Macro to select and print sheets
Option Explicit
Sub testme()
Dim wks As Worksheet
For Each wks In ActiveWorkbook.Worksheets
With wks.Range("g1")
If IsEmpty(.Value) Then
'skip it
Else
If IsNumeric(.Value) Then
.Parent.PrintOut Preview:=True
End If
End If
End With
Next wks
End Sub
JoeP wrote:
I would like to know the code for use in a macro that will
1. look at cell G1 in a sheet and if there is a number in that cell print
the sheet
2. move to the next sheet and look at cell G1 and if there is a number in
that cell print the sheet
3. continue to move to each sheet in the file test cell G1 to see if there
is a number and print the sheet if there is.
Thanks for any help.
--
Dave Peterson
|