vba - Editing code to only copy values and not formulas -
i have code searches text need copied realized carrying on formulas. need paste values of cells. not sure how edit following make happen. thoughts?
initiatives.range("b3:b500") rcount = 0 = lbound(myarr) ubound(myarr) set rng = .find(what:=myarr(i), _ after:=.cells(.cells.count), _ lookin:=xlformulas, _ lookat:=xlpart, _ searchorder:=xlbyrows, _ searchdirection:=xlnext, _ matchcase:=false) if not rng nothing firstaddress = rng.address rcount = rcount + 1 rng.entirerow.copy newsh.rows(rcount) set rng = .findnext(rng) loop while not rng nothing , rng.address <> firstaddress end if next end
try modifying copy code to:
rng.entirerow.copy newsh.cells(rcount,1).pastespecial paste:=xlpastevalues, operation:=xlnone, skipblanks _ :=false, transpose:=false
this gives option of copying whole row, , chosing method of paste want.
Comments
Post a Comment