Q:

Dynamic upper bound for two-dimensional array

I'm determining values for a matrix with 92 rows and a varying range of columns (1-64 columns). Depending on the row number, my code should define the upper bound of the number of columns for that row. I am using nested loops, but my code gives me a matrix of 92x64 (so the number of columns is constant). 
Dim m As Integer
Dim n As Integer
Dim o As Integer
Dim p As Integer
Dim q As Integer
Dim N_bay As Single
Dim N_b As Single
Dim D_r As Single
Dim s As Single
Dim Con_l As Single
Dim tau_s As Single
Dim N_r As Single

D_r = 394.9
s = 4.24
Con_l = 6.1
N_r = 92
N_b = 64

For n = LBound(N_rj, 1) To UBound(N_rj, 1)
    For m = LBound(N_rj, 2) To UBound(N_rj, 2)
        N_rj(n, 1) = n
        N_rj(n, 2) = (D_r - ((n - 1) * s))
        N_rj(n, 3) = WorksheetFunction.RoundDown(((D_r - ((n - 1) * s)) / Con_l), 0)
        N_rj(n, 4) = 1 / (N_rj(n, 3))
        size = N_rj(n, 3)
        ReDim N_bz(1 To 92, 1 To size)
            For o = 1 To UBound(N_bz, 1)
                For p = 1 To UBound(N_bz, 2)
                    N_bz(o, p) = p * Con_l
                    Cells(o + 1, p + 6).Value = N_bz(o, p)
                Next p
            Next o

        Cells(n + 1, m).Value = N_rj(n, m)
    Next m
Next n

I expect to get a matrix with 92 rows, of which each row has a varying number of columns. Hence, row #1 has 64 columns, row #2 has 63 columns, etc.

A:

I suspect what you're trying to do is something like the following
Sub MatrixArray()
    Dim m As Long, n As Long, o As Long, p As Long, q As Long
    Dim size As Long

    Dim N_bay As Single, N_b As Single, D_r As Single, s As Single, Con_l As Single
    Dim tau_s As Single, N_r As Single

    Dim N_rj(1 To 92, 1 To 4) As Single, N_bz() As Single

    Application.ScreenUpdating = False

    D_r = 394.9
    s = 4.24
    Con_l = 6.1
    N_r = 92
    N_b = 64

    For n = LBound(N_rj, 1) To UBound(N_rj, 1)
        For m = LBound(N_rj, 2) To UBound(N_rj, 2)
            N_rj(n, 1) = n
            N_rj(n, 2) = (D_r - ((n - 1) * s))
            N_rj(n, 3) = WorksheetFunction.RoundDown(((D_r - ((n - 1) * s)) / Con_l), 0)
            N_rj(n, 4) = 1 / (N_rj(n, 3))
            size = N_rj(n, 3)
            Debug.Print size

            ReDim N_bz(1 To 92, 1 To size)

            For o = 1 To UBound(N_bz, 1)
                For p = 1 To UBound(N_bz, 2)
                    N_bz(o, p) = p * Con_l
                Next p
            Next o

            Cells(n, 7).Resize(1, UBound(N_bz, 2)).Value2 = Application.Index(N_bz, n, 0)

        Next m
    Next n

    Cells(1, 1).Resize(UBound(N_rj, 1), UBound(N_rj, 2)) = N_rj

    Application.ScreenUpdating = True
End Sub

Something like the following might be more efficient though
Sub MatrixArray()
    Dim m As Long, n As Long, o As Long, p As Long, q As Long
    Dim size As Long

    Dim N_bay As Single, N_b As Single, D_r As Single, s As Single, Con_l As Single
    Dim tau_s As Single, N_r As Single

    Dim N_rj(1 To 92, 1 To 4) As Single, N_bz() As Single

    Application.ScreenUpdating = False

    D_r = 394.9
    s = 4.24
    Con_l = 6.1
    N_r = 92
    N_b = 64

    Dim MaxSize As Long
    MaxSize = WorksheetFunction.RoundDown(((D_r - ((LBound(N_rj, 1) - 1) * s)) / Con_l), 0)
    Debug.Print MaxSize
    ReDim N_bz(1 To MaxSize)

    For p = 1 To UBound(N_bz)
        N_bz(p) = p * Con_l
    Next p

    For n = LBound(N_rj, 1) To UBound(N_rj, 1)
        N_rj(n, 1) = n
        N_rj(n, 2) = (D_r - ((n - 1) * s))
        N_rj(n, 3) = WorksheetFunction.RoundDown(((D_r - ((n - 1) * s)) / Con_l), 0)
        N_rj(n, 4) = 1 / (N_rj(n, 3))
        size = N_rj(n, 3)

        Cells(n, 7).Resize(1, size).Value2 = N_bz
    Next n

    Cells(1, 1).Resize(UBound(N_rj, 1), UBound(N_rj, 2)) = N_rj

    Application.ScreenUpdating = True
End Sub

