|
发表于 2017-7-10 11:35
|
显示全部楼层
本楼为最佳答案
- Private Sub Worksheet_Change(ByVal Target As Range)
- If Target.Count > 1 Then Exit Sub
- If Target.Row < 8 Or Target.Column <> 4 Then Exit Sub
- r = Target.Row: x = Cells(r, "x")
- Set d = CreateObject("scripting.dictionary")
- Application.EnableEvents = False
- If x <> "" Then
- With Sheets("3")
- For c = 1 To .Cells(1, 256).End(xlToLeft).Column
- d(.Cells(1, c).Value) = ""
- Next
- For c = 1 To .Cells(1, 256).End(xlToLeft).Column
- If .Cells(1, c) = "" Then Exit For
- Next
- If Not d.exists(x) Then .Cells(1, c).Resize(3) = Application.Transpose(Array(x, "甲", "乙"))
- End With
- End If
- Application.EnableEvents = True
- End Sub
复制代码 |
评分
-
查看全部评分
|