Excel VBA Type Mismatch on Row Delete
20:33 05 Nov 2025

I have a "simple" comparison that is generating a "Type mismatch" error when I delete a row in the worksheet (worksheet change event fires).

If Target.Column = gblScheduled And Target.Value = "Yes" Then
  1. I've checked the documentation and the Column property is Integer.
  2. I have a global constant with an Integer data type for that comparison.
  3. I've checked the documentation and the Value property is a Variant.
  4. As you can see, the literal would be a String value for that comparison.

VBA coercion should allow that. But, just in case, I did this:

If Target.Column = gblScheduled And Target.Value = CVar("Yes") Then

But that still resulted in a "Type mismatch". Why?

excel vba events