ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] ¼ÆÀx¦s®æÃC¦â¼Æ¥Ø¡C

[µo°Ý] ¼ÆÀx¦s®æÃC¦â¼Æ¥Ø¡C

§Ú­n¦b AÄæ¦ÜJÄ椤¼Æ¦³ÃC¦âªºÀx¦s®æ¼Æ¥Ø¡C(¥u¦³¤@´Ú¶À¦â)
·í«ö¤U«ö¶s«á,«K·|´£¥Ü ¦³¦h¤Ö­Ó¼Æ¥Ø¡C
¦bºô¤W§ä¨ì¥H¤U¸ê®Æ,¦ý¬O©T©w¤F¦b²Ä¤GÄæ,½Ð°Ý¦p¦ó°µ¨ì ¥ÑAÄæ¦ÜJÄæ, §ä¨ì¦³ÃC¦âªºÀx¦s®æ«á,±N¼Æ¥Ø¥Îmsgbox ´£¥Ü¥X¨Ó¡CÁÂÁÂ


Sub test()
Dim sum As Long, Count As Long


sum = 0
Count = 0

For i = 1 To 10

If Cells(i, 2).Interior.ColorIndex = 6 Then

sum = sum + Cells(i, 2).Value

Count = Count + 1

End If

Next i


MsgBox Count & "  different Finds"

End sub

  1. Sub test()
  2. Dim sum As Long, Count As Long


  3. sum = 0
  4. Count = 0

  5. For i = 1 To 10

  6. For j = 1 To 10

  7. If Cells(i, j).Interior.ColorIndex = 6 Then

  8. sum = sum + Cells(i, j).Value

  9. Count = Count + 1

  10. End If

  11. Next j

  12. Next i


  13. MsgBox Count & "  different Finds"

  14. End Sub
½Æ»s¥N½X
¦^´_ 1# stephenlee

TOP

        ÀR«ä¦Û¦b : ¥@¤W¦³¨â¥ó¨Æ¤£¯àµ¥¡G¤@¡B§µ¶¶ ¤G¡B¦æµ½¡C
ªð¦^¦Cªí ¤W¤@¥DÃD