ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Making Contents of a cell input for a Module (https://www.excelbanter.com/excel-programming/302670-making-contents-cell-input-module.html)

anyuan

Making Contents of a cell input for a Module
 
I am currently using this code in a module for a excel worksheet.
want to simply use excel to create variations of groups for a 2 wee
period and list them in a spreadsheet. The following code lis
variations for 3 different people (I link the people to a number code)
but I want the group size to be dynamic (the cell that uses the permut
function) will determine the group size. For example instead of jus
printing all the variations for 1,2, andn 3 I want it to print th
variations for 1,2,3,4,5, etc. up to 9 different group members. Pleas
help me.

Sub Variations()
RowNr = 1
Ilow = 0
For I = 0 To 9
For J = 0 To 9
If J < I Then
For K = 0 To 9
If K < J And K < I Then
For L = 0 To 9
If L < K And L < J And L < I Then
Cells(RowNr, 2) = I * 1000 + J * 100 + K * 10 + L
RowNr = RowNr + 1
End If
Next L
End I

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 08:45 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com