Hi All,
First time posting so hopefully this makes sense:
I have created an excel form that will be used by a number of people
Within the form users can delete rows by clicking on a "delete rows" button. However I only want users to delete specific rows, as such I have locked some of the cells and protected the worksheet so that certain rows cannot be deleted.
The rather simple delete rows macro:
Public Sub Delete()
With ActiveSheet.Buttons(Application.Caller).TopLeftCell.EntireRow.Select
ActiveCell.Offset(2).EntireRow.Delete
End With
End Sub
As expected when the user tries to delete too many rows the macro can't run as the cells are locked and the debug pane pops up.
Instead of the debug pane popping up, I would like a message box to pop up saying "you cannot delete any more rows"
Thanks in advance for your help and please let me know if any further info is needed.
Bookmarks