i am getting this error run time error '91':

object variable or with block variable not set



please let me know

    With Sheet1
         
         
            If target.column < 10 Then          -----------------------getting error error here

        'must disable events if you change the sheet as it will
        'continually trigger the change event
         Application.EnableEvents = False
         Application.Undo
        Application.EnableEvents = True

         MsgBox "You cannot do that!"
       
     End If