I made this matrix code:

Sub matrix1()
Const N = 7, M = 7
Dim Z(1 To N, 1 To M), I, J As Integer

For I = 1 To N
For J = 1 To M
Z(I, J) = Int(-6 + Rnd * (10 + 6))
Next J
Next I

Worksheets("Sheet1").Cells(1, 1).Resize(N, M).Value = Z
End Sub


And I need the code of a one-dimensional array of the positive elements of this matrix.