我想用子程序传递一个用type定义的自定义数据类型.是整个的变量,不是里面的某一个参数。自己试了几次,没成功,请高手指点。先谢过了。

解决方案 »

  1.   

    Option ExplicitPrivate Type t
        i As Integer
    End TypePrivate a As tPrivate Function ss(ByRef a As t) As Boolean
    End FunctionPrivate Sub Command1_Click()
        ss a
    End Sub
      

  2.   

    你是要这样么?
    模块中:
    Type YourType
      strName As String
      strOld As Integer
    End Type程序中:
    Dim theType As YourTypePrivate Sub subDoSomething(InputType As YourType)
      MsgBox InputType.strName
    End Sub
    Private Sub Command1_Click()
    theType.strName = "your name"
    theType.strOld = 18subDoSomething theType
    End Sub