PDA

View Full Version : Application defined or Object defined error



xhuljano
10-22-2012, 08:21 AM
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!


8974

xhuljano
10-22-2012, 09:05 AM
To clarify, whenever a value of <0.50 is detected, it is recorded as a "1" on the exception grid worksheet.

Paul_Hossler
10-22-2012, 11:21 AM
Where do you have the "on the "Number of repeat non conforming sites" row?

Paul

xhuljano
10-22-2012, 11:27 AM
Paul,

I still get the same error on the same line.

Paul_Hossler
10-22-2012, 05:47 PM
In your #1 you said


on the "Number of repeat non conforming sites" row.


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


In the mean time, you have 2 places with


Dim repeatNCCount As Integer



Try making them Double and see if that does anything.

Paul

xhuljano
10-23-2012, 08:19 AM
Hold On, I'll try something

xhuljano
10-23-2012, 08:19 AM
I got something that works ish, but still isn't quite what I want it to

xhuljano
10-23-2012, 08:22 AM
https://www.dropbox.com/s/ize9j1etz2oqsd5/DisinfectantResidual-Final.xls

https://www.dropbox.com/s/1bpeykvngp7pmsl/DisinfectantResidual-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.