- ©«¤l
- 4901
- ¥DÃD
- 44
- ºëµØ
- 24
- ¿n¤À
- 4916
- ÂI¦W
- 257
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Office 20xx
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥x¥_
- µù¥U®É¶¡
- 2010-4-30
- ³Ì«áµn¿ý
- 2024-11-27
|
¦^´_ 6# jcchiang - Sub ex()
- Dim Ar(0 To 7), A As Range, C As Range, TCode, Cnt
- Ar(0) = Array("«È¤á¥N¸¹", "«È¤á§å¸¹", "Icode", "¿é¤J¶q", "TCode", "B1", "B1¥¢±Ñ", "B2", "B2¥¢±Ñ", "B3", "B3¥¢±Ñ", "B4", "B4¥¢±Ñ")
- Set A = Sheet2.[F:F].Find("A120004", lookat:=xlWhole)
- If Not A Is Nothing Then
- For i = -3 To 3
- TCode = A.Offset(i, 7).Value
- Set C = Sheet1.[D:D].Find(TCode, lookat:=xlWhole)
- If Not C Is Nothing And C <> "" Then b1 = C.Offset(, 4).Value Else b1 = 0
- If Not C Is Nothing And C <> "" Then b2 = C.Offset(, 6).Value Else b2 = 0
- If Not C Is Nothing And C <> "" Then b3 = C.Offset(, 8).Value Else b3 = 0
- If Not C Is Nothing And C <> "" Then b4 = C.Offset(, 10).Value Else b4 = 0
- Cnt = A.Offset(i, 4).Value
- Ar(i + 4) = Array(A.Offset(i, -5).Value, A.Offset(i, 0).Value, A.Offset(i, 2).Value, Cnt, TCode, b1, b1 / Cnt, b2, b2 / Cnt, b3, b3 / Cnt, b4, b4 / Cnt)
- Next
- End If
- With Sheet3
- .[A:M].ClearContents
- For i = 7 To 13
- .Columns(i).NumberFormat = "0.00%"
- Next
- .[A1].Resize(8, 13) = Application.Transpose(Application.Transpose(Ar))
- End With
- End Sub
½Æ»s¥N½X |
|