Friends,
I have a global rng variable, r that is stored as the active cell on selection change. Then I have the following subroutine:
Private Sub CommandButton1_Click()
Application.ScreenUpdating = False
Msg1 = MsgBox("Are you sure you want to delete this entry?", vbYesNo, "Delete Entry")
If Msg1 = vbYes Then
ActiveSheet.Unprotect
r.EntireRow.Delete UserForm2.Hide
Unload UserForm2
ActiveSheet.Shapes("CommandButton2").Visible = False
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Else
UserForm2.Hide
Unload UserForm2
End If
Application.ScreenUpdating = True
End Sub
The goal is to delete an entire row of data so that the remaining rows will "shift up" to maintain a contiguous sheet. about 60% of the time it works perfectly fine but when it doesn't, I get a "not enough resources to display completely" error and then a "delete property of range class failed" error.
Any idea how I can get around this inconsistency?
Thanks in advance,
-Mike
Bookmarks