创建一个宏: Sub oo() For a = 1 To 9 For b = 1 To 9 For c = 1 To 9 For d = 1 To 9 r = a + b + c + d If r = 17 Then Cells(Range("A1048576").End(xlUp).Row + 1, 1).Value = a Cells(Range("B1048576").End(xlUp).Row + 1, 2).Value = b Cells(Range("C1048576").End(xlUp).Row + 1, 3).Value = c Cells(Range("D1048576").End(xlUp).Row + 1, 4).Value = d End If Next d Next c Next b Next a End Sub