VBA code erroring in XL97...

S

sharpie23

I wrote some VBA code in XL 2003. when the form was emailed to a 3rd
party using XL97 it errored. I understand that XL97 uses VBA 5.0 and
that it will not recognize functions that were added in VBA 6.0.

Here is the code section that is erroring

For Each i In Range("A71:A74, A77:A80, A83:A86, A89:A92, A95:A98,
A101:A104")
For Each n In Range(Cells(i.Row, 2), Cells(i.Row, 7))
If n.Value = "0" Then
Application.EnableEvents = False
Range(Cells(i.Row, 2), Cells(i.Row, 7)).Interior.ColorIndex
= xlColorIndexNone
Cells(i.Row, 11).ClearContents
Application.EnableEvents = True
GoTo NXTROW

It errors on the line.........If n.Value ="0"

Any Ideas?

Thanks
Ryan
 
D

Dave Peterson

Do you know what's in that cell?

If it's an error (like #n/a), you'll have a problem.

maybe:

if iserror(n) then
'do error processing
else
if n.value = "0" then


or maybe
if n.value = 0 then

would be better????
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top