troubleshooting Question

Problem with Worksheet_Change Event and Deleting Cell Contents

Avatar of bvallanc
bvallancFlag for United States of America asked on
Microsoft Excel
24 Comments1 Solution998 ViewsLast Modified:
Why do I get a Type Mismatch error when I delete the contents of a cell using the code below?


Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Value = "" Then Debug.Print "YES!"

End Sub


If I make Target.Value = 0 I get the same error message.  Can anyone tell me the syntax for capturing the deletion of cell contents?  By that I mean selecting a cell and pressing the <Delete> key.

Many Thanks,

Bill Vallance
ASKER CERTIFIED SOLUTION
NorieAnalyst Assistant
Join our community to see this answer!
Unlock 1 Answer and 24 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 24 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros