+ Reply to Thread
Results 1 to 4 of 4

Application defined or Object defined error

  1. #1
    Registered User
    Join Date
    10-22-2012
    Location
    Philadelphia, USA
    MS-Off Ver
    Excel 2010
    Posts
    3

    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! To clarify, whenever a value of <0.50 is detected, it is recorded as a "1" on the exception grid worksheet.
    Copy of Matthew_Calcs_DisinfectantResidual-Final.zip

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,899

    Re: Application defined or Object defined error

    The variable k is never assigned a value so it retains the default value of 0. When you try to refer to a cell having a column number of 0, you get the error. I can't help because I have no idea what you intend k to be.

  3. #3
    Registered User
    Join Date
    10-22-2012
    Location
    Philadelphia, USA
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Application defined or Object defined error

    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.

  4. #4
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Application defined or Object defined error

    I'm afraid your post does not comply with Rule 8 of our Forum RULES. Cross-posting is when you post the same question in other forums on the web. You'll find people are disinclined to respond to cross-posts because they may be wasting their time solving a problem that has been solved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser)to the cross-post. Expect cross-posts without a link to be closed a message will be posted by the moderator explaining why. We are here to help so help us to help you!

    Read this to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (not just this site).
    Josie

    if at first you don't succeed try doing it the way your wife told you to

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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