-1

我有一个使用 excel 间接函数填充的级联下拉列表,这一切都很好。

但是,当第一个下拉列表的值更改时,我想清除第二个下拉列表的值,因为这现在将无效。

我该怎么做呢?

4

1 回答 1

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

于 2012-12-20T10:49:51.453 回答