i have following scenario: have 2 worksheets raw , bom. populate bom sheet raw components.
for example in bom worksheet have vxl5-50 (highlighted in yellow). component, search sheet1--> 'connector type' column , if string exists. if does, increment 1 in qty column in bom worksheet
here 2 sheets raw , bom
sub test() dim rng range dim dblrow double 'shtsearch,shtcoutn sheet names. lastrow = shtsearch.cells(rows.count, 1).end(xlup).row j = 0 = 1 lastrow if instr(1, shtsearch.cells(i, 1), "abcd", vbtextcompare) > 0 'count search j = j + 1 end if next set scrrng = shtcount.range("a:a") set rng = scrrng.find(what:="abcd", after:=activecell, lookin:=xlformulas, lookat _ :=xlpart, searchorder:=xlbyrows, searchdirection:=xlnext, matchcase:= _ false, searchformat:=false) dblrow = mid(rng.address, 4, len(rng.address) - 3) shtcount.cells(dblrow, 2) = j end sub
you can modify above code , use other criteria.
Comments
Post a Comment