|
??? |
|
最初間違えて玉を元に戻さないとしてしまいました。慌ててはいけない。
Option Explicit Dim a(7) As Integer Sub Macro1() Cells(1, 1).Value = 0 Call saiki(1) Range("A1").Select End Sub Sub saiki(ByVal n As Integer) Dim wa As Integer Dim j As Integer a(n) = 1 While a(n) <= 7 wa = 0 For j = 1 To n wa = wa + a(j) Next j If wa < 7 Then Call saiki(n + 1) Else Cells(1, 1).Value = Cells(1, 1).Value + 1 For j = 1 To n Cells(Cells(1, 1).Value, j + 1).Value = a(j) Next j Range("B" & Cells(1, 1).Value).Select End If a(n) = a(n) + 1 Wend End Sub |
|
3月12日(木) 9:29:49
34086 |