+ Reply to Thread
Results 1 to 2 of 2

VBA code erroring in XL97...

  1. #1
    sharpie23
    Guest

    VBA code erroring in XL97...

    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


  2. #2
    Dave Peterson
    Guest

    Re: VBA code erroring in XL97...

    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????

    sharpie23 wrote:
    >
    > 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


    --

    Dave Peterson

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1