This is my code:
Function test(data As Range)
Const nobs As Integer = data.Columns.Count
'Const nobs As Integer = 2 <- this one works, but not dynamic
Dim AMatrix(1 To nobs, 1 To nobs) As Variant
End Function
Dim needs a constant value in it's argument. How can I use my dynamically changing nobs variable instead?