Probklem with code, when merged cells
Try this
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Then Exit Sub
If Target.Column = 10 Or Target.Column = 15 Then
If Not IsEmpty(Target) Or Target < "" Then
MsgBox "The cell content has been changed"
End If
End If
End Sub
Mike
"Jan Kronsell" wrote:
I have the folowwing code, and it works ok in most cases:
Private Sub Worksheet_Change(ByVal Target As Range)
If ((Target.Column = 10) Or (Target.Column = 15)) Then
If Not IsEmpty(Target) Or Target < "" Then
MsgBox "The cell content has been changed"
End If
End If
End Sub
But if I delete something from a merged cell, in stead of just skipping the
cell (not displaying the messagebox) I get a "Run-Time error '13': Type
mismatch". This only happens on merged cells.
Any idea how to avoid this?
Jan
|