Advertisement
bwh

Combinations

bwh
Mar 24th, 2012
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Sub combin()
  2. mx = 1
  3.     For a = 1 To 10
  4.         For b = a + 1 To 10
  5.             For c = b + 1 To 10
  6.                 For d = c + 1 To 10
  7.                     Cells(mx, 1) = a
  8.                     Cells(mx, 2) = b
  9.                     Cells(mx, 3) = c
  10.                     Cells(mx, 4) = d
  11.                     mx = mx + 1
  12.                 Next
  13.             Next
  14.         Next
  15.     Next
  16. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement