类模块代码Option ExplicitPublic Function Add(ByVal a As Long, ByVal b As Long) As LongAdd = a + b '反回值Add=a+bEnd Function窗体代码Dim s As New Class1Private Sub Command1_Click()MsgBox s.Add(10, 10)End Sub