Return value from distributed numbers VBA Excel -
i'm looking solution in vba or if else vlookup insert value have distributed before.
my scenario next:
i have:
code "total qty" "location 1" "location 2" "location 3" "location 4" 12345 3 1 0 2 0 12346 6 2 2 2 0 12347 3 1 1 1 0 12348 11 5 0 1 5
i have sheet or same sheet scan code , need count total scanned , distribute desire location like:
code location 12345 location 1 12345 location 3 12345 location 3 12346 location 1 12346 location 1 12346 location 2 12346 location 2 12346 location 3 12346 location 3 12347 location 1 12347 location 2 12347 location 3 12348 location 1 12348 location 1 12348 location 1 12348 location 1 12348 location 1 12348 location 3 12348 location 4 12348 location 4 12348 location 4 12348 location 4 12348 location 4
is there way vba macro excel ?
any , hint appreciated.
you can use code this:
in example data origin in sheet7 range a1:f5 , destination sheet8 column a:b, adapt @ will
sub distrib() dim wdest, r integer, c integer, v dim rdest integer, p integer rdest = 1 v = sheet7.range("a1:f5") set wdest = sheet8.range("a:b") r = 2 ubound(v, 1) c = 3 ubound(v, 2) p = 1 v(r, c) wdest(rdest + p - 1, 1) = v(r, 1) wdest(rdest + p - 1, 2) = v(1, c) next rdest = rdest + p - 1 next next end sub
Comments
Post a Comment