- ©«¤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-22
|
Sub ¸ü¤J()
Dim S1 As Worksheet, S2 As Worksheet, Rng1 As Range, Rng2 As Range
Dim Arr, R&, C&, Ck%, N&, xR As Range
Set S1 = Sheets("¼t¯Êªí"): Set S2 = Sheets("¥X³f")
Set Rng1 = S1.[B3:G3]: Set Rng2 = S1.[B4:H4]: Set xR = S1.[B3]
Application.ScreenUpdating = False
Call ²M°£
Arr = Range(S2.[a1], S2.UsedRange)
For C = 45 To UBound(Arr, 2)
Ck = 0
For R = 4 To UBound(Arr)
If Val(Arr(R, C)) <= 0 Then GoTo 101
If Ck = 0 Then
Rng1.Copy xR
xR.Resize(1, 6).VerticalAlignment = xlCenter '¸óÄæ¸m¤¤
xR = Arr(3, C) '¼t¯Ê¦WºÙ
Set xR = xR(2): Ck = 1
End If
'----------------------------
Rng2.Copy xR
xR.Resize(1, 4) = Array(Arr(R, 8), "", Arr(R, 7), Arr(R, C))
xR(1, 7) = Arr(R, 5)
Set xR = xR(2): N = N + 1
101: Next R
Next C
If N = 0 Then Exit Sub
Rng2.Copy xR(2)
xR(2).Resize(1, 7).ClearContents
xR(2).Resize(1, 6).Interior.ColorIndex = 37
xR(2, 4).Resize(1, 3) = "=SUM(R[-" & xR.Row - 3 & "]C:R[-1]C)"
End Sub
Sub ²M°£()
With Sheets("¼t¯Êªí")
.UsedRange.Offset(4, 0).EntireRow.Delete
.[B3] = ""
.[B4:G4].ClearContents
.[F4] = "=IF(MIN(D4:E4)=0,"""",INT(E4/D4))"
.[G4] = "=IF(MIN(D4:E4)=0,"""",MOD(E4,D4))"
.[H3:H4].ClearContents
End With
End Sub
Xl0000142.rar (26.85 KB)
Y»Ý¸óÀÉ, ¦Û¦æ¥hקï~~
=========================================== |
|