how to combine items in 3 columns and produce all combinations usi

  • Thread starter Thread starter Guest
  • Start date Start date
nest 3 loops. Each loop loops over the values in one of the columns.
 
Dim rw as Long, col as Long
dim cellA as Range, cellB as Range
dim cellC as Range
rw = 1
col = 5
for each cellA in Range("A1:A10")
for each cellB in Range("B1:B15")
for each cellC in Range("C1:C8")
cells(rw,col).value = CellA
cells(rw,col+1).value = CellB
cells(rw,col+2).value = CellC
rw = rw + 1
if rw > 60000 then
rw = 1
col = col + 4
end if
Next
Next
Next
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top