excel vba - Entering number in B column then finding number in A column -
sorry if title confusing.
i working on excel file bit complicated.
basically need put number in column b , have macro find same number in column copy (including number) above it.
i have tried using find button cant seem make automatically find number listed in column b in relation column a.
this code have tried far:
range("d1").select cells.find(what:="12", after:=activecell, lookin:=xlformulas, lookat:= _ xlpart, searchorder:=xlbyrows, searchdirection:=xlnext, matchcase:=false _ , searchformat:=false).activate range("a58").select range(selection, cells(1)).select selection.copy
okay, figured out in own way. column has pattern changing part number so:
tim car 1 tim car 2
and on. in column b made formula =if(a3=c1,"copy","") c1 have number input user. made macro finding "copy" in column b offsetting left , made copy way top of column.
it looked this:
sub copy_1() application.screenupdating = false range("b:b").select selection.find(what:="copy", after:=activecell, lookin:=xlvalues, lookat:=xlpart, searchorder:=xlbyrows, searchdirection:=xlnext, matchcase:=true, searchformat:=false).activate activecell.offset(0, -1).activate range(selection, selection.end(xlup)).select selection.copy application.screenupdating = true end sub
Comments
Post a Comment