Answers for "split cell"

VBA
1

excel split

' A2 = "aaaa-bbb-ccc"
' First column / item, separator "-" 	-> aaaa
=LEFT(A2, SEARCH("-",A2,1)-1)
' Middle column / item					-> bbb
=MID(A2, SEARCH("-",A2) + 1, SEARCH("-",A2,SEARCH("-",A2)+1) - SEARCH("-",A2) - 1)
' Last column / item					-> ccc
=RIGHT(A2,LEN(A2) - SEARCH("-", A2, SEARCH("-", A2) + 1))
Posted by: Guest on July-08-2021

Code answers related to "VBA"

Browse Popular Code Answers by Language