VBA按类别自动编号?

发布网友 发布时间: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

声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com