I am trying to create a triple loop in excel that will read from a table and populate three columns with increasing values that are dependent on the values in a table. So the values in column one and two will repeat until column 3 has finished and then two will increase and 1 will repeat until it is finished, and so on. It should ultimately give me values that look something like this. (where the hyphens are column divides.
1-1-1, 1-1-2, 1-1-3, 1-1-4, 1-2-1, 1-2-2, 1-2-3, 1-2-4, 1-3-1, 1-3-2, 1-3-3, 1-3-4, 2-1-1, 2-1-2, etc...
Here is the code that I currently have, but it is not repeating the values in the first two columns while column 3 counts, and it is stopping when column 1 finishes its first round of counting. It needs to start again as column 2 increases itself to the next value.
Thanks for any help you can provide!
Dim i As Integer, iPos As Integer, c As Integer, iRow As Integer, d As Integer, iShl As Integer
iPos = Worksheets("Sheet1").Cells(3, "J").Value
iShl = Worksheets("Sheet1").Cells(3, "I").Value
iRow = Worksheets("Sheet1").Cells(3, "H").Value
For i = 1 To iPos
Cells(i, 3).Value = i
For d = 1 To iShl
Cells(i, 2).Value = d
For c = 1 To iRow
Cells(c, 1).Value = c
Next c
Next d
Next i