I am having trouble with my macro which is fairly simple. It is opening a book, formatting it, and then attempting to extract the information needed from a line of text. The text to run the process on will be D9:D250. Just playing with the sheet I was able to in other cells extract the data I want, but I am having trouble in the macro combining all of those steps into one and have them work. I am attempting to not have to use Cells O,P,Q and would just like the function to run and replace cell D9 with "T" and so on as the data goes.

Cell D9: " A T & T INC (NEW) C:00206R102 # 373177 T "

Cell 09: =FIND("#",D9,1) This gives the numerical value 32

Cell P9: =FIND(" ",MID(D9,O9+2,32),1) This gives the numerical value 7

Cell Q9: =MID(D9,O9+P9+2,10) This isolates the text I need and returns "T"

Currently this is the macro I have up until the point of my failure:

Cell D9: " A T & T INC (NEW) C:00206R102 # 373177 T "

Cell 09: =FIND("#",D9,1) This gives the numerical value 32

Cell P9: =FIND(" ",MID(D9,O9+2,32),1) This gives the numerical value 7

Cell Q9: =MID(D9,O9+P9+2,10) This isolates the text I need and returns "T"

Currently this is the macro I have up until the point of my failure:

Code:

```
Sub Macro1()
'
' Macro1 Macro
'
'
Workbooks.OpenText Filename:="B:\B\B\B.PRN", Origin:=437, _
StartRow:=1, DataType:=xlDelimited, TextQualifier:=xlDoubleQuote, _
ConsecutiveDelimiter:=False, Tab:=False, Semicolon:=False, Comma:=False _
, Space:=False, Other:=True, OtherChar:="""", FieldInfo:=Array(Array(1, _
2), Array(2, 1), Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 1), Array(7, 1), Array(8, 1) _
, Array(9, 1), Array(10, 1), Array(11, 1), Array(12, 1), Array(13, 1)), _
TrailingMinusNumbers:=True
Application.Run "ConnectChartEvents"
Columns("B:L").Select
Columns("B:L").EntireColumn.AutoFit
End Sub
[endcode]
```

Last edited: