Extract any first two letters and 6 digit number from an excel and copy it to another cell -
how extract first 2 letters , 6 digit number 1 cell another? ie. column 1 have aa111111, bb222222, ccccc, dd12, eeee1
i want copy aa111111 , bb222222 in case.
thanks, alex
try short macro:
sub kopykat() dim n long, long, k long dim s string n = cells(rows.count, 1).end(xlup).row k = 1 = 1 n s = cells(i, 1).value if len(s) = 8 _ , mid(s, 1, 1) "[a-za-z]" _ , mid(s, 2, 1) "[a-za-z]" _ , isnumeric(mid(s, 3)) cells(k, 2).value = s k = k + 1 end if next end sub
Comments
Post a Comment