Extracting Text from a text string
Sub exttractdata()
Const EASIER = "EASIER"
Const FASTER = "FASTER"
Const PLAISANT = "MORE PLAISANT"
DataString = Cells(1, "J")
RowCount = 1
For i = 1 To 3
Verb = UCase(Left(DataString, InStr(DataString, ":") - 1))
DataString = Mid(DataString, InStr(DataString, ":") + 1)
Truth = UCase(Left(DataString, InStr(DataString, ",") - 1))
DataString = Mid(DataString, InStr(DataString, ",") + 1)
Select Case Verb
Case EASIER
Cells(RowCount, "K") = Truth
Case FASTER
Cells(RowCount, "L") = Truth
Case PLAISANT
Cells(RowCount, "M") = Truth
End Select
Next i
Cells(RowCount, "N") = DataString
End Sub
"Moises" wrote:
I have the text results of a survey in just one cell stored as text, I would
like to generate the required number of columns as per the answers given, for
example :
In Cell J1 I have :
Easier:no,Faster:no,More Plaisant:no,The original system with the white
boards was easier; faster; and anybody could look at them and tell what was
going on.
I would like to extract the information and generate the columns K (Easier),
L (Faster), M (More Plaisant), N (comments)
with the answers on each column (no, no, no, "The original ...), what should
be the code ?
Thanks in advance
--
Moises
|