excel查重并做操作

来源:百度知道 编辑:UC知道 时间:2024/06/08 18:11:29
查找B3为空且A3=A2
如果为true 则删除第三行。
公式是怎么写?

1.查找B3为空且A3=A2

=OR(B3="",A3=A2)

2.如果为true 则删除第三行

理想功能的实现应该用VB来做
当然不会VB的话,可以用"数据""筛选"选择TURE值来做

用VBA来实现,程序如下:
Private Sub CommandButton1_Click()
If Range("B3").Value = "" And Range("A3").Value = Range("A2").Value Then
Rows("3:3").Delete Shift:=xlUp
End If
End Sub