- ©«¤l
- 116
- ¥DÃD
- 29
- ºëµØ
- 0
- ¿n¤À
- 232
- ÂI¦W
- 0
- §@·~¨t²Î
- winXp
- ³nÅ骩¥»
- office 2003
- ¾\ŪÅv
- 20
- ©Ê§O
- ¤k
- ¨Ó¦Û
- ¥xÆW¥x¤¤¥«
- µù¥U®É¶¡
- 2010-9-6
- ³Ì«áµn¿ý
- 2023-7-11
|
§Ú§Ë¦n¤F¡Aì¨Ó¬On¶K¦b¨Ó·½¨ºÃä¡AµM«á§Ú§âWith Sheet3®³±¼¤F
Sub Ex()
Set dic = CreateObject("Scripting.Dictionary")
Set dicn = CreateObject("Scripting.Dictionary")
For Each a In Sheets("sheet3").Range([H2], [H65536].End(xlUp))
dic(a & a.Offset(, 1)) = dic(a & a.Offset(, 1)) + a.Offset(, 2)
Next
For Each a In Sheets("sheet1").Range(Sheets("sheet1").[A2], Sheets("sheet1").[A65536].End(xlUp))
dicn(a & a.Offset(, 1)) = dicn(a & a.Offset(, 1)) + 1
Next
For Each a In Sheets("sheet1").Range(Sheets("sheet1").[A2], Sheets("sheet1").[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 Sub
èè¤Wºô¬d¤F¤@¤U¥ÎWith Sheet3¥i¥H¨ú¥NSheets("sheet3")
¤]´N¬Oµ{¦¡¥ÑSheets("sheet3").Range([H2], [H65536].End(xlUp))
Åܦ¨.Range(.[H2], .[H65536].End(xlUp))
¤£ª¾¹D¬°¤°»ò.[H2], .[H65536]¤]³£n¦h¤@Ó¤pÂI. ©O¡H¡H³o§Ú´N¤£ª¾¹D¤F |
|