- ©«¤l
- 4901
- ¥DÃD
- 44
- ºëµØ
- 24
- ¿n¤À
- 4916
- ÂI¦W
- 276
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Office 20xx
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥x¥_
- µù¥U®É¶¡
- 2010-4-30
- ³Ì«áµn¿ý
- 2024-12-22
|
- 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)
- b1 = C.Offset(, 4).Value
- b2 = C.Offset(, 6).Value
- b3 = C.Offset(, 8).Value
- b4 = C.Offset(, 10).Value
- Cnt = A.Offset(i, 4).Value
- If Not C Is Nothing And TCode <> "" Then
- 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)
- Else
- Ar(i + 4) = Array(A.Offset(i, -5).Value, A.Offset(i, 0).Value, A.Offset(i, 2).Value, Cnt, TCode, "NA#", "NA#", "NA#", "NA#", "NA#", "NA#", "NA#", "NA#")
- End If
- 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 ¦^´_ 10# jcchiang |
|