我的简单vba函数没有出现?
请等一下Function master(sega)
master(sega) = WorksheetFunction.SumIf([sega], "<80")
End Function
答案 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