You shouldn't oversimply your code/question like that. It makes it harder to debug the errors when the code you post does not create any errors.
You could try something like this, though I am not sure how long it will take it to run (it could take a while):
VBA Code:
Sub Maja2()
Dim K As Long
Dim cl As Long
Dim rw As Long
cl = 1
rw = 1
vals = Array("3", "6", "9")
Application.ScreenUpdating = False
For Each a In vals
For Each b In vals
For Each c In vals
For Each d In vals
For Each e In vals
Cells(rw, cl) = a & b & c & d & e
If rw = Rows.Count Then
rw = 1
cl = cl + 1
Else
rw = rw + 1
End If
Next e
Next d
Next c
Next b
Next a
Application.ScreenUpdating = True
MsgBox "Macro complete"
End Sub
Sub Maja()
Dim K As Long
K = 1
vals = Array("1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49")
For Each a In vals
For Each b In vals
For Each c In vals
For Each d In vals
For Each e In vals
Cells(K, 1) = a & b & c & d & e
K = K + 1
Next e
Next d
Next c
Next b
Next a
MsgBox K
End Sub
This the code I am runing