在vba中循环遍历带有索引的数组并获取特定索引处的元素

use*_*986 2 ms-access vba

我现在正在尝试这样的事情

Dim myAddress() As String
myAddress= Split("4th Street NW Washington, DC")

For intI = 1 To UBound(myAddress)
     `how can i access myAddress[intI+1] from here?
Next intI
Run Code Online (Sandbox Code Playgroud)

duD*_*uDE 5

尝试这个:

Dim myAddress() As String
myAddress= Split("4th Street NW Washington, DC")

For intI = 1 To UBound(myAddress)
    Console.WriteLine(myAddress(intI))
Next intI
Run Code Online (Sandbox Code Playgroud)

  • VBA 默认使用 0 作为第一个数组元素的索引。 (3认同)