View Single Post
  #16   Report Post  
Posted to microsoft.public.excel.programming
GS[_6_] GS[_6_] is offline
external usenet poster
 
Posts: 1,182
Default using formula - extract text separated by 2 spaces

Ok got other same data in a2,a3,... Ie in column A

What row does the data start in?
Are there headers?
Is the data consistent in structure?


Sub ParseValues2()
Dim vData, vTmp, lLastRow&, n&

lLastRow = Cells(Rows.Count, 1).End(xlUp).Row
vData = Range("A1:A" & lLastRow)
For n = 1 To UBound(vData)
vTmp = Split(vData(n, 1), " ")
Range("B" & n).Resize(1, UBound(vTmp) + 1) = vTmp
ActiveSheet.UsedRange.Columns.AutoFit
End Sub

Above code assumes data starts in row1

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus