Vba功能不起作用

时间:2015-10-23 23:33:28

标签: vba function

我的简单vba函数没有出现?

请等一下

Function master(sega)
    master(sega) = WorksheetFunction.SumIf([sega], "<80")
End Function

1 个答案:

答案 0 :(得分:0)

Sub SumifTest()

Dim ws As Worksheet

Set ws = ThisWorkbook.Worksheets("sheet1")

Dim Rng As Range
Set Rng = ws.Range("A:C")

Dim x As Double

x = Master(Rng)
    Debug.Print x

End Sub


Function Master(Sega As Range)

    Master = Application.WorksheetFunction.SumIf(Sega, "< 80")

End Function