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

¨D±Ï: SumColor Function ¦ý­n²Ö¥[«D¼Æ­Èªº©î¸Ñ¤èªk

¨D±Ï: SumColor Function ¦ý­n²Ö¥[«D¼Æ­Èªº©î¸Ñ¤èªk

hi ,

¤p§Ì·Q­n½Ð°Ý¤@¤U, §Ú­Ì¥i¥H¥Î SumColor Function ¥h²Ö¥[¬Y­Ó¯S©w©³¦âªºÀx¦s®æ­È(¦p¤U½d¨Ò),
¦ý¬O­Y§Ú¦³­Ó»Ý¨D, ¨C­ÓÀx¦s®æ¸Ì­±ªº­È³£¬O2­Ó,¨Ò¦p "15/10" ,
§Ú·Q­n¤À§O´£¥X15 or 10 ¨Ó²Î­p幒¼Æ, ¸Ó«ç»ò§ï©O?

¨Ò¦p:  
A1 (©³¦â:¬õ)    10/15
A2  (¥Õ)              4/3
A3   (¬õ)             5/66
A4   (ºñ)             0/30
..........................
§Ú·Q­nºâ¥X¬õ©³Àx¦s®æ¸Ì, ²Ö­p¼Æ­È¬° 10+5=15 («e) »P 15+66=81

Example======================================
Function SumColor(rColor As Range, rSumRange As Range)
Dim rCell As Range
Dim iCol As Integer
Dim vResult
Application.Volatile
iCol = rColor.Interior.ColorIndex
For Each rCell In rSumRange
If rCell.Interior.ColorIndex = iCol Then
vResult = WorksheetFunction.Sum(rCell) + vResult
End If
Next rCell
SumColor = vResult
End Function
===============================
50 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X

RE: ¨D±Ï: SumColor Function ¦ý­n²Ö¥[«D¼Æ­Èªº©î¸Ñ¤èªk (¤w¸Ñ¨M)

¤£¦n·N«ä¥´Åͤj®a
¤w¸g§ä¨ì¤èªk¤F,
¥[­ÓGetElement = Split(rCell, "/")(Num)
§â¼Æ­È¤è¶}´N¥i¥H¤F.ÁÂÁÂ
50 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X

TOP

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