|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
不好意思,这个才对。
Private Sub Worksheet_Change(ByVal Target As Range)
Dim i, j, t, m As Integer
Dim h As Integer
h = Sheet1.Range("C65536").End(xlUp).Row
H2 = Sheet2.Range("G65536").End(xlUp).Row
m = 1
t = 0
If Target.Column = 4 Then
For i = 3 To h
t = 0
For j = 3 To H2
If Sheet2.Cells(j, "G") = Sheet1.Cells(i, "C") And Sheet2.Cells(j, "H") = Sheet1.Cells(i, "D") Then
t = t + 1
End If
Next
If t = 0 Then
Sheet2.Cells(H2 + m, "G") = Sheet1.Cells(i, "C")
Sheet2.Cells(H2 + m, "H") = Sheet1.Cells(i, "D")
m = m + 1
End If
Next
End If
End Sub |
评分
-
1
查看全部评分
-
|