ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   separate mixed data (https://www.excelbanter.com/excel-programming/372716-separate-mixed-data.html)

Prema

separate mixed data
 
I have following data in one cell. 672 15 73.53 49412.16 17.5 8647.13
In this eaxmple there are 6 data elements. Each one could be of varying
length and separated by at least one space (but would vary). I would likie to
know how I could extract each data element separately.

Thank you.

Die_Another_Day

separate mixed data
 
Use the "Text to Columns" Feature on the "Data" Menu. Choose
"Delimited", Check "Space" and check "Treat Consetcutive Delimiters as
1"

Charles Chickering

Prema wrote:
I have following data in one cell. 672 15 73.53 49412.16 17.5 8647.13
In this eaxmple there are 6 data elements. Each one could be of varying
length and separated by at least one space (but would vary). I would likie to
know how I could extract each data element separately.

Thank you.



Bernie Deitrick

separate mixed data
 
In code?

Dim myArr As Variant
Dim i As Integer

myArr = Split(Application.Trim(ActiveCell.Value), " ")

For i = LBound(myArr) To UBound(myArr)
MsgBox myArr(i)
Next i


HTH,
Bernie
MS Excel MVP


"Prema" wrote in message
...
I have following data in one cell. 672 15 73.53 49412.16 17.5 8647.13
In this eaxmple there are 6 data elements. Each one could be of varying
length and separated by at least one space (but would vary). I would likie to
know how I could extract each data element separately.

Thank you.





All times are GMT +1. The time now is 04:47 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com