Results 1 to 2 of 2

Delete method failed - error 1004

Threaded View

  1. #1
    Registered User
    Join Date
    07-26-2007
    Posts
    2

    Delete method failed - error 1004 (RESOLVED)

    Hi, I have been making a spreadsheet and am trying to delete a row through VBA code. To delete the row i call the following function:

    Dim iReply As Integer
    iReply = MsgBox("Are you sure that you want to remove the shift?", vbYesNo, "Remove Shift")
                
    If iReply = vbYes Then
    ActiveSheet.Range("D12").EntireRow.Delete
                
    lLastShiftRow = lLastShiftRow - 1
    Call Refresh
    End If
    however when i run the code i get an error occur on the line:

    ActiveSheet.Range("D12").EntireRow.Delete

    the error message is:

    Run-time error '1004': Delete method of Range class failed.

    i've looked on other sites to try find out why this is, but haven't had much luck. Does anyone know what could be the problem?

    Thanks for any help.
    Last edited by Marbles; 07-26-2007 at 07:47 AM.

Thread Information

Users Browsing this Thread

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

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