Extract items in text, place them in another column

  • Thread starter Thread starter Lane Smith
  • Start date Start date
L

Lane Smith

Can I extract each item in a single cell and place each in column B
with a macro
Example
A1=apple
column b
a
p
p
l
e
Thanks in advance
 
Your question is not clearly stated. Did you want the split-out letters to
be placed in a single cell with each letter on a separate line or did you
want the split-out letters to go in multiple cells, on letter per cell? See
if you can make use of either of these solutions...

Single cell solution
-------------------------------------------------
Sub SplitWithinOneCell()
Dim Txt As String
Txt = StrConv(Range("A1").Value, vbUnicode)
Range("B1").Value = Replace(Left(Txt, Len(Txt) - 1), Chr(0), vbLf)
End Sub

Multiple cell solution
--------------------------------------------------
Sub SplitToMultipleCells()
Dim Txt As String
Txt = StrConv(Range("A1").Value, vbUnicode)
Range("B1").Resize(Len(Range("A1").Value)) = WorksheetFunction. _
Transpose(Split(Left(Txt, Len(Txt) - 1), Chr(0)))
End Sub

Rick Rothstein (MVP - Excel)




"Lane Smith" wrote in message

Can I extract each item in a single cell and place each in column B
with a macro
Example
A1=apple
column b
a
p
p
l
e
Thanks in advance
 
Back
Top