Nested Loops in VBA Excel -
i have need create list based on data. need render numbers 000000 through numbers 080808. hoping format data this...
000000 - chw equipment rtu
000001 - chw equipment chiller
etc. need list of potential combinations of numbers, description of be. like:
=concatenate(a1,c1,e1," - ",b1," ",d1," ",f1)
except looped through possible combinations. can me come loop this? i'm not familiar macros.
a b c d e f 00 chw 00 equipment 00 rtu 01 hhw 01 sm steel pipe 01 chiller 02 steam 02 lb steel pipe 02 split system 03 med gas 03 copper 03 pump 04 ug/soil 04 cast iron 04 boiler 05 domestic water 05 plastic 05 cooling tower 06 compressed air 06 double-wall 06 air compressor 07 natural gas 07 sheetmetal 07 fan 08 refrigerant 08 fixtures 08 unit vent
sub getallcombinations() dim rownum integer dim rowvalue string dim celrange string dim string dim b string dim c string dim d string dim e string dim f string rownum = 1 each cell in range("a2:a10") = range("a" + cstr(cell.row)).value b = range("b" + cstr(cell.row)).value each cell2 in range("c2:c10") c = range("c" + cstr(cell2.row)).value d = range("d" + cstr(cell2.row)).value each cell3 in range("e2:e10") e = range("e" + cstr(cell3.row)).value f = range("f" + cstr(cell3.row)).value range("h" + cstr(rownum)).value = + c + e + " - " + b + d + f rownum = rownum + 1 next next next end sub
Comments
Post a Comment