How to create a Multidimensional Array?

You’re using Ubound incorrectly. The second parameter is which dimension to get the bounds for. Your array only has 2 dimensions, not 3.

Ubound(MatrizCFDI, 1) = number of rows
Ubound(MatrizCFDI, 2) = number of columns

Since you appear to want z to iterate over rows, your code should be

For z As Integer = 1 to Ubound(MatrizCFDI, 1)
   Msgbox MatrizCFDI(z, 3)
Next

As an aside, did you intend to skip MatrizCFDI(0, 3)?

[quote=232071:@Tim Hare]You’re using Ubound incorrectly. The second parameter is which dimension to get the bounds for. Your array only has 2 dimensions, not 3.

Ubound(MatrizCFDI, 1) = number of rows
Ubound(MatrizCFDI, 2) = number of columns

Since you appear to want z to iterate over rows, your code should be

For z As Integer = 1 to Ubound(MatrizCFDI, 1)
   Msgbox MatrizCFDI(z, 3)
Next

As an aside, did you intend to skip MatrizCFDI(0, 3)?[/quote]
But I Write it without problems:

[b]
CountLink As Integer = 478
ReDim MatrizCFDI(Countlink, 3)

For i as Integer =1 to countLink -1

MatrizCFDI(i,3) = Replace(Replace(NthField(NthField(SourceCFDi,filtro, i+1), ";""", 1),"return AccionCfdi('","https://portalcfdi.facturaelectronica.sat.gob.mx/"),"','Recuperacion')","")

Next[/b]

But I decided to write at 3th column.

Because I need to write the "Download LINKS Info " in Column 3

In Column 2 -> “Name of the File”
In Column 1 -> “Name of The Company Emitter”
In Column 0 -> “Date of the Document”

But Now I have values written on 3th Column I Wanna consult it.

Thanks

You seem to be confusing Index with Dimension. Ubound works on Dimension. You extract the data based on Index.

Dim my2dArray(100, 20, 5)
msgbox(str(Ubound(my2dArray, 1)) // 100
msgbox(str(Ubound(my2dArray, 2)) // 20
msgbox(str(Ubound(my2dArray, 3)) // 5

x = my2dArray(92, 17, 2)

[quote=232073:@Gerardo García]CountLink As Integer = 478
ReDim MatrizCFDI(Countlink, 3)[/quote]
Here, Ubound(MatrizCFDI, 1) is CountLink, and Ubound(MatrizCFDI, 2) is 3.
So

for z = 1 to CountLink

is equivalent to

for z = 1 to Ubound(MatrizCFDI, 1)

Also, your examples are a little sloppy about the boundaries of the array. You tend to be off by one. For example

skips a value on either end of the range.

Digging through the old posts looking for something else and I found this. I referenced back to the User guide and it seems that something like this discussion would be very helpful if boiled down to specifics. This is the sum total of info in the user’s guide under Arrays:

Multi-Dimensional Arrays

A multi-dimensional array has elements in 2 or more dimensions. A table would be an example of a 2-dimensional array because it has columns and rows.

Most of the array methods are not supported for multi-dimensional arrays.

You declare multi-dimensional arrays by specifying the upper bound for each dimension:

' A 5x5 table
Dim table(4, 4) As Integer
table(1, 3) = 42