ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   splitting one column into rows depending on the data in the column (https://www.excelbanter.com/excel-programming/355744-splitting-one-column-into-rows-depending-data-column.html)

[email protected]

splitting one column into rows depending on the data in the column
 
i have some text data in a single column in the following manner
there is a condition number and some data say d1 d2 d3 d4 ..
d100etc..followed by it(data is also numeric).. the condiotion numbers
are in ascending order..and may vary from 1 to 200..
i want the data to be in different columns( the column number being
the condition number)
and the entris in the column should be the data items (d1 d2 d3...)


Toppers

splitting one column into rows depending on the data in the colum
 
Something along these lines- assumes condition & data is separated by a blank.

Dim cell As Range, row As Long, col As Integer, data as string
For Each cell In Range("a1:a100") '<== change to your requirements
col = CInt(Left(cell, InStr(1, cell, " ") - 1))
data = Right(cell, Len(cell) - InStr(1, cell, " "))
Cells(row, col) = data ' <=== Set row ?
Next

HTH
" wrote:

i have some text data in a single column in the following manner
there is a condition number and some data say d1 d2 d3 d4 ..
d100etc..followed by it(data is also numeric).. the condiotion numbers
are in ascending order..and may vary from 1 to 200..
i want the data to be in different columns( the column number being
the condition number)
and the entris in the column should be the data items (d1 d2 d3...)




All times are GMT +1. The time now is 06:50 AM.

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