Parsing Question! :) help needed bigtime...
I have an issue where data in cells could look like a few different ways:
14.83
140.83
1140.8
1140.83
1140.83(Session: 84848)
Basically, I'm drawing a blank on how to parse the data. Obviously the data string length is dynamic. My main goal is to find IF the cell has the "(Session: 84848)" then delete that, but keep the 1140.83. And it needs to be dynamic...
Any thoughts? Would I use the InStr?
I'm stuck!
TIA!
-Scott
scott@fightingzero.com
well, you understand that the data must conform to some resemblance of order to be parsed. Having said that, based on your sample data, probably the simplest method would be to use the split function with a "(" as a delimiter. After that, your relevant data would be in the 0th element of the resultant array...get it?
ex.
dim MyData as string = "
1140.83(Session: 84848)"
dim a() as string = MyData.Split(cchar("(")) '<<=that looks awkward as hell
dim MyRelevantData as string = a(0)
HTH
kevin