excel vba - How to print array and values from new cycle to next rows -


this part of code working , have 1 problem. have array values (masyvas) , started new loop find other values using masyvas(i,1) values , after need new values printed in masyvas(i,2) , need group them. need this:

991988 gaz.duon.sk"giros"gaiv.g.1,5l 5_petØflat1,5

        palink 

117388 silp.gaz.nat.min.v"tiche'1,5l 5_petØflat1,5

       palink        rimi lietuva        ŠiauliŲ tara  

111388 gaz.nat.min.v"tiche" 1,5l pet 5_petØflat1,5

       palink        aibĖs logistika        aibĖs logistika        rimi lietuva        ŠiauliŲ tara  

how looks marked 1 goes wrong

data sheet array values

here part of code have problem prints new values next masyvas(i,2) not below need.

lastrow2 = sheets("lapas").cells(rows.count, 1).end(xlup).row  rub = lastrow2 cub = 3  redim masyvas(1 rub, 1 cub) = 1 rub    j = 1 cub       masyvas(i, j) = sheets("lapas").cells(i, j).value 'array gets values filtered data in akcijos sheet    next next  sheets("lapas").range("a1:c100").clear    = 1 rub step 1 set rng2 = grafikas.cells(6 + h, 2)      prekeskodas = masyvas(i, 1)           m = 2 lastrow             if akcijos.cells(m, 8) >= laikas , akcijos.cells(m, 8) <= laikas2                 if prekeskodas = akcijos.cells(m, 4)                  grafikas.cells(7 + r, 2).entirerow.select                 selection.insert shift:=xldown                 grafikas.cells(7 + r, 3) = akcijos.cells(m, 3)                  r = r + 1                 h = r                 end if              end if          next m      j = 1 cub step 1        rng2.offset(i - 1, j - 1).value = masyvas(i, j)      next   next 

you didn't provide screenshot of data, it's hard problem , desired output, try code below. marked changed lines.

for = 1 rub prekeskodas = masyvas(i, 1)  m = 2 lastrow     if akcijos.cells(m, 8) >= laikas , akcijos.cells(m, 8) <= laikas2         if prekeskodas = akcijos.cells(m, 4)             'masyvas(i, 2) = masyvas(i, 2) & akcijos.cells(m, 3)            masyvas(i, m) = masyvas(i, m) & akcijos.cells(m, 3) '<------          end if     end if next  j = 1 cub      rng2.offset(j - 1, - 1).value = masyvas(i, j) '<-----  next next 

Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -