- 调用sub子方法,能够调用但是不能返回值
Sub Hello()
Dim param As String
param = "hello帅哥! "
Call sub1(param)
End Sub
Sub sub1(ByVal param As String)
MsgBox "你再说一遍,你跟我说啥?" + param
End Sub
- 调用function子方法,能调用,能返回值
Sub Hello()
Dim param As String
param = "hello帅哥! "
param = sub1(param)
MsgBox param
End Sub
Function sub1(ByVal param As String) As String
param = "你再说一遍,你跟我说啥?" + param
sub1 = param
End Function