Results 1 to 3 of 3

Runtime error 1004 application-defined or object-defined error

Threaded View

tymkiw Runtime error 1004... 10-10-2014, 01:03 PM
LJMetzger Re: Runtime error 1004... 10-10-2014, 04:02 PM
tymkiw Re: Runtime error 1004... 10-13-2014, 09:13 AM
  1. #1
    Registered User
    Join Date
    10-10-2014
    Location
    Newark, DE
    MS-Off Ver
    Home and Student 2013
    Posts
    4

    Runtime error 1004 application-defined or object-defined error

    Hello everyone! I am trying to run a macro that calculates some summary statistics on flooding data. Sometimes it works beautifully, and sometimes it returns a runtime error. The only pattern I can see is that it tends to happen when the area is >50% flooded, though not always. I've attached 1 working and 1 non-working data set. I have no idea why this error comes up. Any help would be much appreciated! Macro code is as follows (input row/column may need to be adjusted for each data set):


    Sub WaterLevelMacro()
    ' Set RangeToIncrement = Selection
    outputrow = 15
    outputColumn = 12
    Row = 13
    Column = 6
    Endrow = 2885
    Do Until Row = Endrow
    If Cells(Row, Column).Value > 0 Then
    Do Until Cells(Row, Column).Value <= 0
    Count = Count + 1
    Sum = Sum + Cells(Row, Column).Value
    Cells(outputrow, outputColumn).Formula = Count * 15
    Cells(outputrow, outputColumn + 1).Formula = Sum / Count
    Cells(outputrow, outputColumn + 2).Value = Cells(Row, 1).Value
    Row = Row + 1
    Loop
    outputrow = outputrow + 1
    Else

    Row = Row + 1
    Count = 0
    Sum = 0
    End If
    Loop
    Beep
    End Sub
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Runtime error 1004 - Application-defined or object-defined error
    By missit in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 04-15-2014, 03:40 AM
  2. Replies: 0
    Last Post: 05-14-2012, 11:59 PM
  3. Runtime error '1004' Application-defined or object-defined error Comment
    By Willer in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-17-2011, 03:02 PM
  4. RE: Runtime error 1004- application defined or object defined erro
    By Novice in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-06-2006, 05:40 PM
  5. [SOLVED] RE: Runtime error 1004- application defined or object defined erro
    By Jim Thomlinson in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-06-2006, 05:35 PM

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