Data analysts write programs to sift through data. One aspect of that is parsing, that is, extracting the data you want from a bunch of data with a particular format.
Here's code that parses data.
Dim rawData As String Dim cc As String Dim ccl As Integer Dim temp As String Dim result As String rawData = "dwe|334.25|faa|32.5|faj|4.5" cc = "faa" ccl = InStr(rawData, cc) temp = Mid(rawData, ccl + Len(cc) + 1) ccl = InStr(temp, "|") result = Left(temp, ccl - 1)
What is the value of
result at the end of the program?
Work it out on paper first, before you try it in Excel.
Try putting the program into Excel. Change
cc to one of the other codes, and see if the program still works.