2012-01-07 127 views
0

如何在VBA中創建嵌套結構?當我在VB編輯器中嘗試下面的代碼時,它會說「語句無效,內部類型塊」。VBA中的嵌套結構

Type Functiondetails 

    Function As String 
    Sites(7) As String 
    Values(7) As Integer 

End Type 

Type Financialdetails 

    Metrics As String 

    Dim f(10) As Functiondetials  

End Type 

回答

2

取下第二類型的Dim(和拼寫正確Functiondetails!);

Type Financialdetails 
    Metrics As String 
    f(10) As Functiondetails 
End Type 

您應該可以,但它也可能不會像Function作爲標識符。

+0

謝謝,它的工作 – 2012-01-08 17:43:31