excel - How do I search a column for cells that contain certain text, and copy that cell into a new column? -
im pretty new @ vba code in excel, , looking run piece reference string of text in column or column b, , spit out complete value in column c.
so, if word "test" appears in cell in column or column b - paste value in list format in column c.
its important note search doesnt need match exactly, needs find word "test" - ie: "123test123" in column still pass , "123test123" written column c.
any appreciated on this!
thanks!
try this:
sub dural() dim ab range, r range, k long set ab = range("a:b").cells.specialcells(xlcelltypeconstants) k = 1 each r in ab if instr(1, r.value, "test") > 0 r.copy cells(k, "c") k = k + 1 end if next end sub
Comments
Post a Comment