Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456 ユーザー定義関数を利用する:Excel VBA入門
Function zei(myRng As Range) As Double
Dim c As Range
Dim goukei As Double
Application.Volatile
goukei = Application.WorksheetFunction.Sum(myRng)
zei = Int(goukei * 5 / 100)
End Function
Function aka_goukei(myRng As Range) As Double
Dim c As Range
Dim goukei As Double
Application.Volatile
For Each c In myRng
If c.Interior.ColorIndex = 3 Then '赤色
goukei = goukei + c.Value
End If
Next c
aka_goukei = goukei
End Function