Hi Timbo
You could loop through the cells as I suggested in my last post or you can
use Find, which I think is more efficient...
Sub PrintSomeSheets()
Dim PrintCodes As Variant
Dim PrintPage As Boolean
Dim CodeRange As Range
Dim Found As Variant
PrintCodes = Split("ABA,AB,AC,ACQ,WH,A,ACX", ",") ' Here goes all codes
Application.ActivePrinter = "\\bristol\Canon CLC4040-H1 PS Ver1.0 2 on
Ne04:"
For Each sh In ActiveWorkbook.Sheets
Set CodeRange = sh.Range("N6:N200")
For c = LBound(PrintCodes) To UBound(PrintCodes)
Set Found = CodeRange.Find(what:=PrintCodes(c),
After:=sh.Range("N200"), Lookat:=xlWhole)
If Not Found Is Nothing Then
PrintPage = True
Exit For
End If
Next
If PrintPage = True Then
sh.PrintOut Copies:=1, ActivePrinter:= _
"\\bristol\Canon CLC4040-H1 PS Ver1.0 2 on Ne04:",
Collate:=True
End If
PrintPage = False
Next
End Sub
Regards,
Per
"Timbo" skrev i meddelelsen
...
I want to find the code which will be in column N anywhere N6 and N200,
which would be the best option for that? I don't have access to Excel
2007.
--
Timbo
------------------------------------------------------------------------
Timbo's Profile: http://www.thecodecage.com/forumz/member.php?userid=24
View this thread:
http://www.thecodecage.com/forumz/sh...d.php?t=110050