excel - Delete all columns containing partial value -
i'm trying create vba code using row 1 header , deleting columns contain "s2" in header. need code search s2 partial search because have other headers labeled xyz s2, abc s2, etc. so, want search contains s2 , delete columns criteria. help, thx
cpnsider:
sub dural() dim n long, long, r range, v variant n = cells(1, columns.count).end(xltoleft).column = n 1 step -1 set r = cells(1, i) v = r.value if instr(1, v, "s2") > 0 r.entirecolumn.delete next end sub
Comments
Post a Comment