Mega Code Archive

 
Categories / VisualBasic Script / Excel
 

Preventing data validation from being destroyed

Private Sub Worksheet_Change(ByVal Target As Range)     Dim VT As Long     On Error Resume Next     VT = Range("A1").Validation.Type     If Err.Number <> 0 Then         Application.Undo         MsgBox "canceled."     End If End Sub