字典学习中。。。
Private Sub CommandButton1_Click()
Dim i, j, arr, d
i = Range("A" & Rows.Count).End(xlUp).Row
Set d = CreateObject("Scripting.Dictionary")
arr = Range("A3:B" & i).Value
For j = 1 To i - 2
If arr(j, 1) = "1.2" Then d(arr(j, 2)) = arr(j, 1)
Next
Range("G3").Resize(d.Count, 1) = Application.WorksheetFunction.Transpose(d.keys)
Set d = Nothing
End Sub
Sub tt2()
Dim i As Integer
Dim c As Range
i = 3
With Range("a2:a500")
Set c = .Find("1.2", LookIn:=xlValues)
If Not c Is Nothing Then
firstAddress = c.Address
Do
Cells(i, 7) = c.Offset(0, 1)
i = i + 1
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> firstAddress
End If
End With
字典学习中。。。
Private Sub CommandButton1_Click()
Dim i, j, arr, d
i = Range("A" & Rows.Count).End(xlUp).Row
Set d = CreateObject("Scripting.Dictionary")
arr = Range("A3:B" & i).Value
For j = 1 To i - 2
If arr(j, 1) = "1.2" Then d(arr(j, 2)) = arr(j, 1)
Next
Range("G3").Resize(d.Count, 1) = Application.WorksheetFunction.Transpose(d.keys)
Set d = Nothing
End Sub