- ©«¤l
- 2834
- ¥DÃD
- 10
- ºëµØ
- 0
- ¿n¤À
- 2890
- ÂI¦W
- 0
- §@·~¨t²Î
- ¡e²¤¡f
- ³nÅ骩¥»
- ¡e²¤¡f
- ¾\ŪÅv
- 100
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¡e²¤¡f
- µù¥U®É¶¡
- 2013-5-13
- ³Ì«áµn¿ý
- 2024-11-26
|
¦^´_ 6# john2006168
Sub TEST()
Dim xR As Range, CL, U%, xH As Range, SS
Call «¸m
CL = Array(35, 36)
For Each xR In Range("D2:D" & Cells(Rows.Count, "k").End(xlUp).Row) '¥HkÄæ¨ú¸ê®Æ¦C¼Æ, xR«h±qD2©¹¤U°j°é
If xR(1, 8) <> xR(0, 8) Then Set xH = xR: SS = 0 'xR(1,8) DÄ橹¥k8®æ, §Y¬OKÄæ; xR(1, 8) <> xR(0, 8) 1¬O¥»®æ,0¬O¤W¤@®æ,2¬O¤U¤@®æ ---¥H¤Uµ{¦¡½X¦P²z
SS = SS + Val(xR(1, 2))
If xR(1, 8) <> xR(2, 8) Then
xH(1, 3) = SS: U = 1 - U
Range(xR(1, 8), xH).Interior.ColorIndex = CL(U)
Range(xH(1, 3), xR(1, 3)).Merge
End If
Next
End Sub
Sub «¸m()
With Range([D2], Cells(Rows.Count, "k").End(xlUp))
.UnMerge
.Interior.ColorIndex = 0
.Columns(3).ClearContents
End With
End Sub |
|