Results 1 to 8 of 8

Keep receiving Run-time error '1004': Application-defined or object-defined error

Threaded View

  1. #1
    Registered User
    Join Date
    10-15-2014
    Location
    DC
    MS-Off Ver
    2010 (work) / 2013 (home)
    Posts
    15

    Keep receiving Run-time error '1004': Application-defined or object-defined error

    I'm having trouble correcting this code I've written to output certain values on one of my data sheets to another sheet. I keep receiving the Run-time error '1004': Application-defined or object-defined error.

    Any suggestions on how I can go about fixing this?



    Sub ThirtyMinuteWarning()
        
        Dim Row As Long
        Dim EndRow As Long
        Dim NextRow As Long
        Dim NumWarnings As Integer
        
        Row = 4
        EndRow = Cells(Rows.Count, 3).End(xlUp).Row
        NextRow = 10
        
        Do Until Row = EndRow
            If Cells(Row, 5).Value <> "" Then
                For DoorCount = 4 To EndRow
                If Cells(Row, 5).Value = Cells(DoorCount, 5).Value And Row <> DoorCount Then
                    For TimeCount = 4 To EndRow
                    If Cells(Row, 4).Value - 1 > Cells(TimeCount, 4).Value And Cells(Row, 4).Value - 6 <= Cells(TimeCount, 4).Value Then
                    Sheets("30 Minute Warnings").Cells(NextRow, 5).Value = Sheets("Calculations").Cells(Row, 6).Value
                    Sheets("30 Minute Warnings").Cells(NextRow, 6).Value = Sheets("Calculations").Cells(Row, 1).Value
                    Sheets("30 Minute Warnings").Cells(NextRow, 7).Value = Sheets("Calculations").Cells(Row, 5).Value
                    Sheets("30 Minute Warnings").Cells(NextRow, 8).Value = Sheets("Calculations").Cells(Row, 3).Value
                    End If
                    NextRow = NextRow + 1
                    Next TimeCount
                End If
                Next DoorCount
            End If
            Row = Row + 1
        Loop
    
        NumWarnings = Sheets("30 Minute Warnings").Cells(Rows.Count, 5).End(xlUp).Row - 5
        Sheets("30 Minute Warnings").Cells(6, 5).Value = NumWarnings
        
    
    End Sub
    Last edited by Fotis1991; 10-23-2014 at 09:46 AM. Reason: Pls use code tags around your codes!

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. excel macro run time error '1004'- Application defined or object defined error
    By kmadan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-16-2014, 09:51 AM
  2. Replies: 1
    Last Post: 03-12-2014, 12:42 PM
  3. [SOLVED] Run time error 1004 Application-Defined or Object-Defined Error - Placing data into next e
    By michelle 1 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 01-27-2014, 12:57 PM
  4. [SOLVED] Error " Run-time error '1004': application defined or object defined error
    By lengwer in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-11-2013, 07:26 AM
  5. [SOLVED] run-time error '1004' application-defined or object-defined error - Excel 2007
    By kaurka in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-06-2012, 02:46 AM

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