- ©«¤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
               
|
¦^´_ 1# yanto913 - Sub Ex()
- Set dic = CreateObject("Scripting.Dictionary")
- Set dicn = CreateObject("Scripting.Dictionary")
- With Sheet2
- For Each a In .Range(.[H2], .[H65536].End(xlUp))
- dic(a & a.Offset(, 1)) = dic(a & a.Offset(, 1)) + a.Offset(, 2)
- Next
- For Each a In .Range(.[A2], .[A65536].End(xlUp))
- dicn(a & a.Offset(, 1)) = dicn(a & a.Offset(, 1)) + 1
- Next
- For Each a In .Range(.[A2], .[A65536].End(xlUp))
- If a <> "" Then
- mytime = Application.Min(a.Offset(, 4), dic(a & a.Offset(, 1)))
- If dicn(a & a.Offset(, 1)) = 1 Then
- a.Offset(, 5) = Val(dic(a & a.Offset(, 1)))
- Else
- a.Offset(, 5) = mytime
- dicn(a & a.Offset(, 1)) = dicn(a & a.Offset(, 1)) - 1
- dic(a & a.Offset(, 1)) = dic(a & a.Offset(, 1)) - mytime
- End If
- End If
- Next
- End With
- End Sub
½Æ»s¥N½X |
|