try this from anywhere in the workbook. Notice the periods . !
with sheets("Print Area")
x=.cells(columns.count,8).end(xltoright).column
if ucase(.cells("b",x))="YES" then PrintBatch
end with

Signature
Don Guillett
SalesAid Software
donaldb@281.com
> I need to create a macro in VBA that will look at a specific cell (which
> contains the result of a lookup formula) in an If statement. Basically it
[quoted text clipped - 17 lines]
>
> Thanks again for any help.
Wolf - 27 Dec 2004 19:39 GMT
Don,
Thanks for your help. For some reason when I did a cut and paste, the If
Ucase line kept coming back with a debug error. I changed it a bit to:
With Sheets("Print Area")
If UCase(.Cells(8, 67)) = "YES" Then PrintBatch
End With
So far it appears to do what I need it to do (keeps fingers crossed).
Thanks again for all your help and have a safe and Happy New Year.
> try this from anywhere in the workbook. Notice the periods . !
>
[quoted text clipped - 27 lines]
> >
> > Thanks again for any help.
Don Guillett - 27 Dec 2004 23:27 GMT
That's cuz I goofed. Try with a period just before columns.count
x=.cells(.columns.count,8).end(xltoright).column

Signature
Don Guillett
SalesAid Software
donaldb@281.com
> Don,
>
[quoted text clipped - 39 lines]
> > >
> > > Thanks again for any help.