View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Toppers Toppers is offline
external usenet poster
 
Posts: 4,339
Default 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...)