Consulting

Results 1 to 8 of 8

Thread: Application defined or Object defined error

  1. #1

    Application defined or Object defined error

    Hello all,

    I'm writing this macro that takes a location, date and value and displays it in a few different ways. The problem is that in the "Summary Table" Worksheet in the attached file, the macro gives me an error here:

    st.Cells(9, k) = repeatNCCount

    The objective is to reference the "Exception Grid" worksheet and check if there are more than one cells with a value of "1" each month. The locations are across row 2 labeled 1-83 (To hide their identity).

    What I can't get it to do is to display the sum of the sites, with values of <0.50 that occur more than twice a month, on the "Number of repeat non conforming sites" row.

    Anyone have any idea as to why that happens? How can I fix it?

    Thanks!

    PS All the data has been already loaded in the excel file, just hit OK when your'e prompted to!


    Copy of Matthew_Calcs_DisinfectantResidual-Final.zip

  2. #2
    To clarify, whenever a value of <0.50 is detected, it is recorded as a "1" on the exception grid worksheet.

  3. #3
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,728
    Location
    Where do you have the "on the "Number of repeat non conforming sites" row?

    Paul

  4. #4
    Paul,

    I still get the same error on the same line.

  5. #5
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,728
    Location
    In your #1 you said

    [VBA]
    on the "Number of repeat non conforming sites" row.
    [/VBA]

    I couldn't find a row with that label. Did I miss it?


    In the mean time, you have 2 places with

    [VBA]
    Dim repeatNCCount As Integer
    [/VBA]


    Try making them Double and see if that does anything.

    Paul

  6. #6
    Hold On, I'll try something

  7. #7
    I got something that works ish, but still isn't quite what I want it to

  8. #8
    https://www.dropbox.com/s/ize9j1etz2...dual-Final.xls

    https://www.dropbox.com/s/1bpeykvngp...esidual-V2.xls

    Those are the two different versions I'm experimenting with. It's all the same code up until the part where it's giving me an error.

    Basically, I need it to look at the exception grid worksheet, check each month individually and record how many locations, in that month, have the value of "1", in the exception grid, appear more than once. It works for some months, but for others it doesn't. (That's the V2 file that works but is inconsistent. The "Final" file doesnt work at all.

Posting Permissions

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