jjj = FreeFile Open "D:\combinations4outof9.txt" For Output As #jjj of = 9 For c1 = 1 To of - 3 For c2 = c1 + 1 To of - 2 For c3 = c2 + 1 To of - 1 For c4 = c3 + 1 To of Print #jjj, c1, ",", c2, ",", c3, ",", c4 Next c4 Next c3 Next c2 Next c1