I'm attempting to use VBA that converts a month name from a data validation list to the month number value in the cell. It does so but if I attempt to delete the contents of the cell, I get an error code and message that the VBA needs to be debugged. I've tried to modify the code to allow the clearing of contents of the selected cell but nothing I've tried works. Can someone please offer a solution? Here's the code I'm using:

Private Sub Worksheet_Change(ByVal Target As Range)
selectedNa = Target.Value
If Target.Column = 50 Then
selectedNum = Application.VLookup(selectedNa, ActiveSheet.Range("Month"), 2, False)
If Not IsError(selectedNum) Then
Target.Value = selectedNum
End If
End If
End Sub

Thank you in advance.