0

How can I create a nested structure in VBA? When I try the following code in VB Editor it is saying "Statement invalid inside type block".

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

1 Answer 1

2

Remove the Dim from the 2nd Type (and spell Functiondetails correctly!);

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

You should be ok but it also may not like Function as an identifier.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.