I have a written a little piece of code that i cannot seem to get to work, basically when a range is selected (in this case D9) i want a message box to appear, vbyesno choices given and then a simple clear contents to follow, can some one help me with why this does not work?
As Always, thanks in advance
<code>Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = Range("D9").Address Then
MsgBox("Do You Want To Delete all Historical Data For This Person?", vbYesNo + vbQuestion)
If vbYes Then
Range("ManData").ClearContents
Else
Exit Sub
MsgBox "Please Enter New Name, All old Data Has Been Cleared"
End Sub<code>
As Always, thanks in advance
<code>Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = Range("D9").Address Then
MsgBox("Do You Want To Delete all Historical Data For This Person?", vbYesNo + vbQuestion)
If vbYes Then
Range("ManData").ClearContents
Else
Exit Sub
MsgBox "Please Enter New Name, All old Data Has Been Cleared"
End Sub<code>