2012-12-20 62 views

回答

2
Private Sub Worksheet_Change(ByVal Target As Range) 
    Dim oneCell As Range 
    On Error GoTo ErrorOut 
    For Each oneCell In ActiveSheet.Cells.SpecialCells(xlCellTypeAllValidation) 
     If Not oneCell.Validation.Value Then oneCell.ClearContents 
    Next oneCell 
ErrorOut: 
Application.EnableEvents = True 
On Error GoTo 0 
End Sub 

供您参考>http://www.contextures.com/xlDataVal02.html

+0

这是可能的,而不VBA? – user1786107

+0

你应该检查http://www.contextures.com/xlDataVal02.html 我认为他们没有vb解释。 –

+0

您实际上没有在代码 – brettdj