Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
For Each t In Target
If t.Value.....
Next t
Sub SetupTrapping()
'New event handler for Edit/Delete on the Worksheet Menu
CommandBars("Worksheet Menu Bar").Controls("&Edit"). _
Controls(10).OnAction = "EditMenuDelete"
'New event handler for Delete on the Cell Popup Menu
CommandBars("Cell").Controls("&Delete...").OnAction = "CellPopUpDelete"
'New event handler for Delete on the Row Popup Menu
CommandBars("Row").Controls("&Delete...").OnAction = "RowPopUpDelete"
End Sub
Sub EditMenuDelete()
On Error Resume Next
'Put your code here to inspect selected row and/or abort deletion.
'MsgBox for demo/test only
MsgBox "Inside Edit/Delete Trap", vbInformation + vbOKOnly, ""
'Invoke Delete method
Selection.Delete
End Sub
Sub CellPopUpDelete()
On Error Resume Next
MsgBox "Inside Cells/Delete Trap", vbInformation + vbOKOnly, ""
'Invoke standard Delete cell dialog
Application.Dialogs(xlDialogEditDelete).Show
End Sub
Sub RowPopUpDelete()
On Error Resume Next
MsgBox "Inside Rows/Delete Trap", vbInformation + vbOKOnly, ""
Selection.Rows.Delete
End Sub
Sub RestoreAll()
CommandBars("Worksheet Menu Bar").Controls("&Edit"). _
Controls(10).OnAction = ""
CommandBars("Cell").Controls("&Delete...").OnAction = ""
CommandBars("Row").Controls("&Delete...").OnAction = ""
End Sub