- ©«¤l
- 835
- ¥DÃD
- 6
- ºëµØ
- 0
- ¿n¤À
- 915
- ÂI¦W
- 16
- §@·~¨t²Î
- Win 10,7
- ³nÅ骩¥»
- 2019,2013,2003
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2010-5-3
- ³Ì«áµn¿ý
- 2024-11-14
|
¦^´_ 11# donod
¹q¸£³o´X¤Ñ¤S±¾¤F,¨ì¤µ¤Ñµ{¦¡¤~§Ë¥X¨Ó.
§A¬Ý¬Ý¬O§_OK, µ{¦¡¦p¤U:- Sub nn()
- Dim iCol%, iCols%, iNum%, iIdx%, iI%, iJ%
- Dim lRow&, lRows&, lSum&(0 To 1)
- Dim bChk(0 To 1, 0 To 1) As Boolean
-
- lSum(0) = 0
- lSum(1) = 0
- For lRow = 9 To 11
- For iI = 0 To 1
- For iJ = 0 To 1
- bChk(iI, iJ) = False
- Next
- Next
- For iCol = 2 To 18
- With Cells(lRow, iCol)
- If Not .Value = "" Then ' µL¼Æ¦r¤£³B²z
- iIdx = IIf(.Interior.ColorIndex = 43, 1, 0)
- If Left(.Value, 1) = "[" Then
- bChk(iIdx, 0) = True
- iNum = Val(Mid(.Value, 2, Len(.Value) - 2))
- Else
- bChk(iIdx, 0) = False
- iNum = Val(.Value)
- End If
-
- If Not bChk(iIdx, 0) And bChk(iIdx, 1) Then
- bChk(iIdx, 1) = False
- ElseIf iNum >= Cells(5, 2 + iIdx * 2) Then
- lSum(iIdx) = lSum(iIdx) + Cells(5, 2 + iIdx * 2)
- If bChk(iIdx, 0) Then bChk(iIdx, 1) = True
- ElseIf iNum <= Cells(5, 3 + iIdx * 2) Then
- lSum(iIdx) = lSum(iIdx) + Cells(5, 3 + iIdx * 2)
- If bChk(iIdx, 0) Then bChk(iIdx, 1) = True
- Else
- If Not bChk(iIdx, 0) Then
- lSum(iIdx) = lSum(iIdx) + iNum
- bChk(iIdx, 1) = False
- End If
- End If
- End If
- End With
- Next iCol
- Next lRow
- MsgBox "ºñ¦â®æÁ`¼Æ¬° : " & lSum(1) & Chr(10) & Chr(10) & Chr(10) & "µL¦â®æÁ`¼Æ¬° : " & lSum(0)
- End Sub
½Æ»s¥N½X |
|