Consulting

Results 1 to 3 of 3

Thread: message to delete value in cell

  1. #1
    VBAX Tutor
    Joined
    Jan 2011
    Posts
    272
    Location

    message to delete value in cell

    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-prog...e-in-cell.html

    Help me please
    Thanks to all

  2. #2
    Mac Moderator VBAX Guru mikerickson's Avatar
    Joined
    May 2007
    Location
    Davis CA
    Posts
    2,778
    You could put this in the sheet's code module.
    [VBA]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[/VBA]

  3. #3
    VBAX Tutor
    Joined
    Jan 2011
    Posts
    272
    Location

    [SOLVED]

    Hi..

    Thank you
    you are a great guru

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •