excel - Cutting letters from alphanumeric cell entry, pasting to another cell -
how can set macro strip letters #####xx in column , put them in column l same row? thanks!
assuming you're working first sheet , you're stripping off last 2 characters while leaving first 5 characters, following code work:
public sub stripoff() dim irow integer irow = 2 'assuming row 1 headers, else make 1 while sheets(1).range("i" + cstr(irow)).value <> "" sheets(1).range("l" + cstr(irow)).value = right(sheets(1).range("i" + cstr(irow)).value, 2) sheets(1).range("i" + cstr(irow)).value = left(sheets(1).range("i" + cstr(irow)).value, 5) irow = irow + 1 wend end sub
Comments
Post a Comment