It's an exercise to work with Arrays in VBA:
Sub M_snb()
With Foglio1
.Range("AU10:AU27").NumberFormat = "@"
.Range("AU11:AU28") = .Range("B64:B81").Value
.Range("E26:AT26") = "'01"
sn = .Range("E8:AU32")
End With
For jj = 1 To UBound(sn, 2) - 1
c00 = c00 & " " & jj
If sn(1, jj) > 1 Then
c00 = c00 & " " & UBound(sn, 2)
sn(20, jj) = 2
sn(21, jj) = 1
End If
Next
sp = Application.Index(sn, [row(1:25)], Split(Trim(c00)))
With Foglio1.Cells(100, 1).Resize(UBound(sp), UBound(sp, 2) - 1)
.NumberFormat = "@"
.Value = sp
End With
End Sub