Hello, I am trying to write the values of two arrays (one boolean and the other integer of one dimension of 50 values each one) to a worksheet.

the code i use is this:

For I = 0 to 10
Cells(1 + I, "A").Value = I +1
Cells(1 + I, "B").Value = Array_Bool(I)
Cells(1 + I, "C").Value = Array_Int(I)
Next I

The problem I get is that Excel gives me an error:

' Error '9' occurred in execution time. '
' Subindex out of interval '

(translated from spanish)

the third line is marked in yellow with the debug option, and if I mark it as comment, then the same happens with the fourth line.

variables are declared this way:

Dim Array_Bool(50) As Boolean
Dim Array_Int(50) As Integer
Dim I As Integer

Also, it works if I manually write this:
Cells(25, 2).Value = Array_Bool(0)
Cells(26, 2).Value = Array_Bool(1)
Cells(27, 2).Value = Array_Bool(2)
Cells(28, 2).Value = Array_Bool(3)
Cells(29, 2).Value = Array_Bool(4)
Cells(30, 2).Value = Array_Bool(5)
Cells(31, 2).Value = Array_Bool(6)
Cells(32, 2).Value = Array_Bool(7)
Cells(33, 2).Value = Array_Bool(0)

Cells(25, 3).Value = Array_Int(0)
Cells(26, 3).Value = Array_Int(1)
Cells(27, 3).Value = Array_Int(2)
Cells(28, 3).Value = Array_Int(3)
Cells(29, 3).Value = Array_Int(4)
Cells(30, 3).Value = Array_Int(5)
Cells(31, 3).Value = Array_Int(6)
Cells(32, 3).Value = Array_Int(7)
Cells(33, 3).Value = Array_Int(0)



Shouldn't the first code and the second one produce the same result??