PDA

View Full Version : message to delete value in cell



marreco
01-08-2012, 12:46 PM
Hi..

I would take a message whenever the User tried to delete any value in any worksheet cell.

If you chose OK then the cell would be deleted if you chose to Cancel the cell will not be deleted.

cross-posting
http://www.excelforum.com/excel-programming/808432-message-to-delete-value-in-cell.html

Help me please: pray2:
Thanks to all

mikerickson
01-08-2012, 01:45 PM
You could put this in the sheet's code module.
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Cells.Count = 1 Then
If .Value = vbNullString Then
If MsgBox("Delete OK?", vbOKCancel) = vbCancel Then
Application.Undo
End If
End If

End If
End With
End Sub

marreco
01-08-2012, 04:42 PM
Hi..

Thank you
you are a great guru:bow: