Sub Remove_Column_H_Values()'
' Remove_Column_H_Values Macro
'
'
Application.Goto Reference:="R7C9"
ActiveSheet.ListObjects("Table11").Range.AutoFilter Field:=8, Criteria1:= _
"<>"
Application.Goto Reference:="R7C8"
Range("H8").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.ClearContents
Application.Goto Reference:="R7C9"
ActiveSheet.ListObjects("Table11").Range.AutoFilter Field:=8
Range("I8").Select
End Sub
答案 0 :(得分:0)
您可以使用此代码在工作表中添加一个按钮。
Sub Remove_Column_H_Values()
Dim i As Integer
For i = 1 To 100 'depends on how long your Values go
If Yoursheet.Cells(i, 9) = "Yes" Then
Yoursheet.Cells(i, 8) = ""
End If
Next
End Sub
答案 1 :(得分:0)
自动,在第一列中输入“是”后: (在工作表模块中)
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If Target.Column = 9 And UCase(Target.Value) = "YES" Then Target.Offset(, -1) = Empty
End Sub