发布网友 发布时间:2022-04-23 16:15
共1个回答
热心网友 时间:2023-10-09 05:37
Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo box
Dim i&
If Target.Row > 7 And Target.Column > 3 And Target.Column < 7 Then
r = Target.Row
If Application.CountA(Range("d" & r & ":f" & r)) = 3 Then
Cells(r, 3) = Application.VLookup(Cells(r, 6), Range("h1:i100"), 2, 0) & _
Format(Application.CountIf(Range("f8:f" & r), Cells(r, 6)), "0000")
End If
End If
GoTo 0
box: MsgBox "未找到匹配值!", , "提示:"
0:
End Sub