2012-12-20 60 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