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.
Bookmarks