- ©«¤l
- 4901
- ¥DÃD
- 44
- ºëµØ
- 24
- ¿n¤À
- 4916
- ÂI¦W
- 62
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Office 20xx
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥x¥_
- µù¥U®É¶¡
- 2010-4-30
- ³Ì«áµn¿ý
- 2025-3-13
               
|
¦^´_ 15# hugh0620 - Private Sub CommandButton1_Click()
- Dim Ay()
- Set d = CreateObject("Scripting.Dictionary")
- Set d1 = CreateObject("Scripting.Dictionary")
- With Sheet2
- .Unprotect "1234"
- ar = .Range(.[B5], .[B65536].End(xlUp).Offset(, 2))
- For i = 1 To UBound(ar, 1)
- mystr1 = Join(Array(ar(i, 1), ar(i, 2), ar(i, 3)))
- d(mystr1) = d.Count
- Next
- With Sheet1
- ar = .Range(.[B5], .[B65536].End(xlUp).Offset(, 6))
- For i = 1 To UBound(ar, 1)
- mystr1 = Join(Array(ar(i, 1), ar(i, 2), ar(i, 6)))
- If d.exists(mystr1) = False Then
- ReDim Preserve Ay(s)
- Ay(s) = Array(ar(i, 1), ar(i, 2), ar(i, 6), ar(i, 7))
- s = s + 1
- Else
- d1(mystr1) = ar(i, 7)
- End If
- Next
- End With
- For Each a In .Range(.[B5], .[B65536].End(xlUp))
- mystr1 = Join(Array(a, a.Offset(, 1), a.Offset(, 2)))
- a.Offset(, 3) = d1(mystr1)
- Next
- If s > 0 Then .[B65536].End(xlUp).Offset(1, 0).Resize(s, 4) = Application.Transpose(Application.Transpose(Ay))
- .Protect "1234"
- End With
- End Sub
½Æ»s¥N½X |
|