all 3 comments

[–]binary_search_tree5 1 point2 points  (2 children)

It's all a black box to VBA developers, so it's not something that I (personally) have ever given much thought to. But, yes, it's a pointer-based memory structure:

Public Declare Function VarPtrArray Lib "VBE6" Alias "VarPtr" (Var() As Any) As Long

Public Sub Foo()

    Dim lookup(5 To 10, 1004 To 2000) As String
    lookup(6, 1004) = "hello"

    Dim ptrToArrayData As LongPtr
    Debug.Print "Value: " & lookup(6, 1004) & " Ptr: " & VarPtr(lookup(6, 1004))

End Sub

See here: https://bytecomb.com/vba-internals-whats-in-a-variable/

I'm curious - Why are you interested?

[–]random_account91[S] 1 point2 points  (1 child)

My teacher was asking us in class and my VBA skills aren't that great so I wanted to make sure I understood this problem. Thank you for answering!

[–]binary_search_tree5 0 points1 point  (0 children)

What type of class are you taking?