excel vba - How do I separate all the strings in a column and paste each substring into other columns? (by VBA) -
right have strings in column a:
aa-bb-cc-123 aa-bb-cc-345 aa-bb-cc-789 etc... how separate string "-" in vba , have each sub-string pasted in different columns? example:
column w column x column y column z aa bb cc 123 aa bb cc 456 aa bb cc 789 any appreciated!
you try following code:
sub split_atow() dim x long, mydata x = 1 range("a65526").end(xlup).row 'x = first row here, change 2 if header row exists mydata = split(range("a" & x), "-") 'put data in column array split "-" range("w" & x).resize(1, ubound(mydata) + 1).value = mydata 'put data in split array w onwards next x end sub
Comments
Post a Comment