MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Messagebox


Posted by Vosje on September 05, 2001 7:19 AM

I want that when cell "C14" is "7" that a message box will appear and ask "Are you done?" if "yes" then it's supposed to delete cell "B14" if "no" it's supposed to go back without doing anything. And if cell "C14" isn't "7" that nothing will happen! Hope someone can help me out on this one!

Vosje


Posted by Barrie Davidson on September 05, 2001 8:01 AM

Try this code in the sheet's code.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim answer As String
If Range("B14") = "" Then Exit Sub
If Range("C7").Value = 7 Then
answer = MsgBox("Are you done", vbQuestion + vbYesNo)
If answer = vbYes Then
Range("B14").ClearContents
End If
Else
End If
End Sub


Regards,
Barrie